Mailmerge with regions without adding new paragraphs

Hi.

I have the problem that sometimes I need a way to execute mailmerge with region but instead new paragraphs I would need only a “,” between them.

So instead

Anna Will
Marcel Johanson

I would like to get

Anna Will, Marcel Johanson

“Anna Will” is the first and last name of a person object in that case. So My fields would look like
[tablestart:persons] [firstname] [lastname] [tableend:persons]

Do you know if this is possible? Perhaps some event handling of node change actions while merging?

Kind regards
TK

Hello
Thank you for your interest in Aspose.Words. There is no direct way to achieve what you are looking for. But, I think, in your case you can try using MergeField event handler to achieve this. Please see the following forum thread for more information:
https://forum.aspose.com/t/72092
Also, in one of future versions of Aspose.Words we will add more Mail Merge syntax and you will be able to repeat only part of a paragraph during mail merge. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.
Best regards,

Thanks a lot.

Hi,

Thanks for being patient.

Regarding WORDSNET-3197, it is to update you that we have closed this issue. We have introduced a new LINQ Reporting Engine which is a part of the Aspose.Words API that enables you to build reports using an extended set of reporting features. The engine enables you to reference business objects of your application in report templates directly, which agrees well with Domain-Driven Design widely used in modern software development. Moreover, the engine uses a subset of C# language in its template syntax. These features enable you as a developer to compose report templates in a familiar and intuitive way.

For example, using this new reporting engine you can repeat part of a Paragraph as follows:

DocumentBuilder builder = new DocumentBuilder();
builder.Write("The items are: <<foreach [item in items]>><<[item]>>, <</foreach>>and others.");
Document doc = builder.Document;
ReportingEngine engine = new ReportingEngine();
engine.BuildReport(doc, new string[] { "Item1", "Item2", "Item3"}, "items");
doc.Save("out.docx");

For more details, please visit this article:
https://docs.aspose.com/words/net/linq-reporting-engine-api/

I hope, this helps.

Best regards,

The issues you have found earlier (filed as WORDSNET-3197) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)