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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Merge Fields with '':'' do not enumerate

Thread ID:

Created:

Updated:

Platform:

Replies:

60467 May 4,2007 11:49 PM May 17,2007 06:05 AM Windows Forms 6
loading
Tags: DocIO
Josh H
Asked On May 4, 2007 11:49 PM

Is it possible to fix it so Merge Fields in a pre-existing Word document with the character ':' in them get processed properly before the next release?

I have a merge field named "Business : City". Tried "Business - City" and that works ok. But I need to support ':'.

Thanks.

Josh H
Replied On May 5, 2007 12:36 AM

I see now that you use the ':' character to detect the presence of a Group Merge field. Does this mean I will have to find a workaround?

Also, another question. I notice in your Sales Invoice sample, you use ExecuteGroup to generate related table information into the document. Your example only shows this with one record.

Will this support multiple records, with child records? If so, what order must I merge.

Bhuvaneswari P [Syncfusion]
Replied On May 8, 2007 08:08 AM

Hi Josh,

Issue1:

Could you please elaborate the issue and could you please provide me the sample to reproduce the issue. This would be very helpful to investigate the issue further.

Issue 2:

Sales Invoice Will this support multiple records, with child records?
This is can be achieved by using the below code snippet,
//Excute MailMerge
doc.MailMerge.Execute(dataReader1);
I have modified the sales invoice sample as your requirement. Herewith I have attached the sample for your reference:
http://websamples.syncfusion.com/samples/DocIO.Windows/F60467/main.htm

Herewith I have attached the sample 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.

Josh H
Replied On May 10, 2007 07:04 PM

Thank you for the sample. However, it does not produce the merge functionality I am curious about. You will notice in your sample that a new and separate invoice is produced for each Order Detail item! Each Order detail item associated with an order should appear on the same invoice page.
That is what I want to know how to do. Could you please create a new sample where all associated order details are on the same invoice?

Thanks, Josh

Bhuvaneswari P [Syncfusion]
Replied On May 14, 2007 06:57 AM

Hi Josh,

Thank you for your update.

I have created a new sample for multiple records.

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

Herewith I have attached the generated Document.
Sample.doc

Please take a look into this. If it does not meet your requirements, could you please provide me with more details regarding this.

Best Regards,
Bhuvaneswari

Josh H
Replied On May 16, 2007 08:43 PM

I'm sorry, the revised sample is not what I'm looking for.

Again, I would need a separate invoice for each order, not one single invoice with many different orders to different customers.

Assuming each customer needs his/her own invoice for a specific order, a separate invoice showing just his/her order information should be produced.

On different page(s), would be another invoice with the next orders' information, and so on.

I have attached a sample of the output I would expect, providing I have a database structure similar to Northwind.

I hope this clarifies the information.
Thanks for the help.

SyncSampleNeeded.zip

Bhuvaneswari P [Syncfusion]
Replied On May 17, 2007 06:05 AM

Hi Josh,

Thank you for information.

This is not possible to create a separate invoice for each customer. However, this would be possible by using the below workaround, Generate each invoice separately and merge into one document using cloning and merging concept.

Code Snippet:
for (int i = 0; i < listBoxCustomer.SelectedItems.Count; i++)
{
// execute Mail Merge with groups.
doc.MailMerge.ExecuteGroup(GetTestOrder((int)listBoxCustomer.SelectedItems[i])); doc.MailMerge.ExecuteGroup(GetTestOrderTotals((int)listBoxCustomer.SelectedItems[i]));
// Using Merge events to do conditional formatting during runtime.
doc.MailMerge.MergeField += new MergeFieldEventHandler(MailMerge_MergeField);
DataView orderDetails = new DataView(GetTestOrderDetails((int)listBoxCustomer.SelectedItems[i]));
orderDetails.Sort = "ExtendedPrice DESC";
doc.MailMerge.ExecuteGroup(orderDetails);
// Enumerate all the sections from the template document.
foreach (IWSection sec in doc.Sections)
{
// Cloning all the sections one by one and merging it to the new document.
doc1.Sections.Add(sec.Clone(doc1));
// Setting section break code to be the same as the template.
doc1.LastSection.BreakCode = sec.BreakCode;
}
}
doc1.Save("sample1.doc");

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

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

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

Best Regards,
Bhuvaneswari.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;