Problems with CR/LF within word tables


#1

Hi Roman,

I don’t think this is an issue with Aspose.Word, however I just wanted to check to see whether this has been an issue for anyone else.

We have mocked up an invoice for a demonstration of Aspose to the business.
The invoice can contain any number of transactions, making it any number of pages in length.

We have contained the tranactions with a word table which automatically resizes depending on the number of transactions being put on the invoice.

A tranaction is made up of a transaction details column and a tranaction amount column.

Transaction details may contain more than 1 piece of data, which will need to be physically CR/LF rather than word wrapped.

e.g.

Transaction Details Transaction Amount
Reference
Reference


e.g.

Service Fees £ 150.00
Lawyer @ £100
Admin @ £50


As you can see we need CR/LF at the end of each item as the information would not be displayed correctly if word wrapped. Therefore we tried passing through the ASCII codes for CR/LF in the XML.

e.g.
Service Fees
Lawyer @ £100
Admin @ £50


works fine outside of a word table, but it is not recognised inside. A control character is printed instead. Have you guys come across this problem, and do you know of a fix for it?

Thanks,
Rich.


#2

In general, this should work and we had customers inserting multiple paragraphs successfully.

You might try using just #13 when inserting the data, although I’m not sure this will help.

How do you insert the data into the Word document? Using merge field or DocumentBuilder? Let me know and I will do the tests here.




#3

Hi Roman,

I tried passing
in the data to print in a Mergefield contained within a Word table, and had the same problem. A control character is printed instead of the command being executed.

We are using MailMerge.ExecuteWithRegions as the information is repeating, so we are enclosing the MergeFields within TableStart and TableEnd in the template. The repeating information is all placed inside a Word table as it is being presented in statement format.

We have tested passing
in the data to a MergeField outside of a Word table and the command was carried out. We tested this as a standalone MergeField, and also a MergeField enclosed within TableStart and TableEnd, in both instances the commend was carried out. This leads me to think that the issue lies within the Word table.

Any help you can give would be greatly appreciated.

On the bright side of things, both Document Production demonstrations to the business using Aspose have been a success. We have approval to go ahead and purchase Aspose.Component. Your technical support has been a driving factor behind our demos being a roaring success, so myself and everyone involved here owes you a huge thanks for that.

Thanks,
Rich.


#4

Hi Rich,

Aspose.Word 1.6.1 that addresses this issue is available http://www.aspose.com/forums/ShowPost.aspx?PostID=8134#8225.

Now your value can have \r, \r\n or \n characters, they all get converted into MS Word paragraphs.