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.htmHerewith I have attached the generated document for your reference:
sample1.docPlease take a look into this and let me know if you have any other queries.
Best Regards,
Bhuvaneswari.