We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Result of MailMerge.ExecuteGroup not in a table ?

Hi,

I use the MailMerge.ExecuteGroup function and it works great to me. However I have a question : is it possible to make a template who have the results of a MailMerge.ExecuteGroup not in a table ?

I'll give some samples, I have this data :
Age FirstName Name
Adult Homer Simpsons
Adult Marge Simpsons
Children Bart Simpsons
Children Lisa Simpsons
Children Maggie Simpsons.

I can do that :

****************************
Adult
Homer Simpsons
Marge Simpsons

Children
Bart Simpsons
...
****************************

It's in a table (1 row, 2 colmumns for each), it works great, now can I do that :

****************************
Adult
Firstname Homer
Name Simpsons
Firstname Marge
Name Simpsons

Children
Firstname Bart
Name Simpsons
...
****************************

Always in a table (2 rows, 2 columns for each) ? It doesn't work for me.

Now can I do :

****************************
- one page for the "Adult" data (it's works)
- ONE page for each person (one page with Homer, one page with Marge, etc...) with Firstname and Name datas not in a table ?
****************************

I've tried to cheat :), I've tested that :

- Make a 1 row, 2 columns table
- Put the start and the other fields in the first column and the end field in the second.
- Write what I want in the first column with the fiels : labels, empty lignes, etc...

It works but I think, it's really not a clear way to do, hope that is not the only way !! :) !!

Hope I was clear.

Thanks a lot for your help.

Lucie

13 Replies

BP Bhuvaneswari P Syncfusion Team April 30, 2007 12:36 PM UTC

Hi Lucie,

Sorry for the delay in getting back to you.

If you are wanted to merge fields in page instead of table, you can use the following code snippet:

// Execute Mail Merge
document.MailMerge.Execute( dataReader );

Herewith I have attached the sample for your reference:
MailMerge

Herewith I have attached the document for your reference:
Sample.doc

I hope this would meet your requirement. Please let me know if you have any other queries.

Thank you for your interest in Syncfusion products.

Best Regards,
Bhuvaneswari.




BP Bhuvaneswari P Syncfusion Team April 30, 2007 12:38 PM UTC

Hi Lucie,

Sorry for the delay in getting back to you.

If you are wanted to merge fields in page instead of table, you can use the following code snippet:

// Execute Mail Merge
document.MailMerge.Execute( dataReader );

Herewith I have attached the sample for your reference:
http://websamples.syncfusion.com/samples/DocIO.Windows/F60102/main.htm

Herewith I have attached the document for your reference:
Sample.doc

I hope this would meet your requirement. Please let me know if you have any other queries.

Thank you for your interest in Syncfusion products.

Best Regards,
Bhuvaneswari.



LU Lucie April 30, 2007 01:45 PM UTC

Hi,

Thanks for your answer et your samples. I know this command : document.MailMerge.Execute. My problem is that I've two levels, I think I wasn't clear enough. In my examples : I have 2 dataset :

**************
- Adults
- Children
**************

and

**************
- Adults Homer Simpsons
- Adults Marge Simpsons
- Children Bart Simpsons
- Children Lisa Simpsons
- Children Maggie Simpsons
**************

If I take your example (screenshot), I need 7 pages :

- Adults
- Homer .....
- Marge .....
- Children
- Bart ....
- Lisa ....
- Maggie ....

I think that if I use document.MailMerge.Execute I'll can have only the kinds or only the names, but not both ?

Hope I'm clearer :)

Thanks for your help.

Lucie


LU Lucie April 30, 2007 01:52 PM UTC

.... to be clearer ....

I don't want that the "age" or "kind of person" to be repeated but be displayed one time and after the persons who match.

Thanks.


BP Bhuvaneswari P Syncfusion Team May 1, 2007 12:51 PM UTC

Hi Lucie,

Thanks for your update.

Currently it is not possible to display a particular column of the database only once in mail merge. Sorry for the inconvenience caused.

Please let me know if you have any other queries.

Thank you for your interest in Syncfusion products.

Best Regards,
Bhuvaneswari.


LU Lucie May 2, 2007 07:36 AM UTC

Hi,

Thanks for your answer, but it makes me think that I wasn't clear enough :) So I'll try once again with another example.

In some of your sample templates, I can see a page with a list of customers and for each a table with the products they ordered. So I can have a page for each customer :

- page 1 :

customer1

product1a
product1b
product1c

- page 2 :

customer2

product2a
product2b
product2c

I would like to know if it is possible to have a page for each customer and a page for each product (instead of having them in a table) :

- page 1 : customer1
- page 2 : product1a
- page 3 : product1b
- page 4 : product1c
- page 5 : customer2
- page 6 : product2a
- page 7 : product2b
- page 8 : product2c


I'm really sorry for the misunderstood, I'm a french developper and my english isn't really good :)

Thanks again for your help.

Lucie


BP Bhuvaneswari P Syncfusion Team May 2, 2007 02:23 PM UTC


Hi Lucie,

I have created a sample as you said and it display one page for each customer and one page for each product.

Herewith I have attached the sample for your reference:

http://websamples.syncfusion.com/samples/DocIO.Windows/F60102_1//main.htm

Herewith I have attached the document for your reference:

Sample.doc

Please take a look into this and let me know if you have any other queries.

Thank you for your interest in Syncfusion products.

Best Regards,
Bhuvaneswari.


LU Lucie May 3, 2007 07:00 AM UTC

Hi,

In your example, if you have 2 tables of data :

************************
John
David
************************

and

************************
John Producta
John Productb
John Productc
David Producta
David Productb
David Productc
************************

So your example fits my problem very well. Could you show me the code to do that, please ?

Thanks a lot for your help.

Lucie


BP Bhuvaneswari P Syncfusion Team May 4, 2007 01:05 PM UTC

Hi Lucie,

I have created a sample as you said and it display one page for each customer and one page for each product using the above two tables. We cannot directly merge using these tables, so I have modified the sample to produce correct output.

Herewith I have attached the sample for your reference:

http://websamples.syncfusion.com/samples/DocIO.Windows/F60102_4//main.htm

Please take a look into this and let me know if you have any other queries.

Thank you for your interest in Syncfusion products.

Best Regards,
Bhuvaneswari.


LU Lucie May 10, 2007 01:54 PM UTC

Hi Bhuvaneswari

Thanks a lot for your sample. My problem is that in your example you know the name and above all the number of products (in your template : you write "Producta", "Productb", "Productc" and in the code side too). In my problem, I don't know these informations, so I can't put the fields for all the products in my template.

I mean, I can't write "Producta", "Productb", "Productc", I need a way to put ONE field "Products" (because I don't know the number).

In the sample that we can see in the doc or on the site, you have customers with a table of several products (you use MailMerge.ExecuteGroup). I guess in this example, you don't know the number of products. I need a way to do the same thing (display each customer with products (name, quantity, etc.)) but with products on each page.

Thanks for your help.

Lucie


BP Bhuvaneswari P Syncfusion Team May 11, 2007 01:46 PM UTC

Hi Lucie,

Thanks you for your detailed information.

Currently it is not possible to show the customer name only once followed by the product name alone in each page. Since the mail merge executes row by row, the name of the customer gets repeated along with the product name in each page. Sorry for the inconvenience caused.

Please let me know if you have any other queries.

Best Regards,
Bhuvaneswari.


LU Lucie May 14, 2007 07:26 AM UTC

Hi,

Thanks for your answer and your help.

Lucie


BP Bhuvaneswari P Syncfusion Team May 14, 2007 12:53 PM UTC

Hi Lucie,

Thank you for your update. Please let me know if you have any queries.

Best Regards,
Bhuvaneswari.

Loader.
Live Chat Icon For mobile
Up arrow icon