Categories > OpenTBS with DOCX >

Line breaks (\r\n) in MySQL data not automatically converted when using MergeBlock

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: w5m
Date: 2016-09-09
Time: 18:25

Line breaks (\r\n) in MySQL data not automatically converted when using MergeBlock

Hi there,

I'm using OpenTBS to merge a MySQL query with a docx Word document and it works brilliantly. My query retrieves a MySQL longtext field which sometimes contains \r\n characters in amongst the true text (e.g. 1234 London Road,\r\nBrighton). In the merged document, the text is displayed exactly as it was in the MySQL table (i.e. 1234 London Road,\r\nBrighton). From what I have read, OpenTBS should be automatically converting \r\n to an MS Word equivalent. Is my understanding correct? If not, what do I need to do to enable this behaviour?

$TBS->MergeBlock('MyBlockName', $cnx_id, $sql_query);

Any advice would be much appreciated.
By: Skrol29
Date: 2016-09-13
Time: 12:17

Re: Line breaks (\r\n) in MySQL data not automatically converted when using MergeBlock