We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

About Mail Merge & Table Style

Hi,

I want to use mail merge to generate table row , but I need to change odd & even row background color, I set the table style in word but it’s not working. Does someone know how to do it ??

If I use ReportingEngine to do this, how can I remove emtpy paragraph like mail-merge ?

Because I have a cell need to put two fields, but sometimes only one field has value. I need to remove the empty paragraph to make the cell vertical align middle.

Thanks.

PS: doc.ExpandTableStylesToDirectFormatting(); also not working.

aspose word api ver. 17.2.0.0

Hi there,

Thanks for your inquiry. Please refer to the following article and get the code of HandleMergeFieldAlternatingRows class from Aspose.Words for .NET examples repository at GitHub.

How to Apply Custom Formatting during Mail Merge

The code example shared in above links shows how to set background color of odd & even rows. Hope this helps you.

alonstar:

PS: doc.ExpandTableStylesToDirectFormatting(); also not working.

Could you please attach your input Word document along with code example here for testing? We will investigate the issue on our side and provide you more information.

Hi,

The sample project is vary useful. If I use ReportingEngine, I can skip break line use <><><> .

Thank you.

Hi there,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.