Friday, 4 October 2013

NextReports Designer: Hidden Gems

Today someone needed to add a line break inside an expression, and to see the result inside different formats like HTML, PDF, RTF, EXCEL.  This means the line break must be considered even if the column width is big enough to fill the entire text on a single row, so "wrap text" property is not useful in such situation.

For HTML , adding a simple <br> tag does the trick. An expression like

$C_First_Name + "< br >" +  $C_Last_Name

will show the expression from a cell with the needed line break:

But for other formats like PDF, RTF and EXCEL the solution was not so obvious. Trying with "\n" had no effect. The needed character was the unicode representation for line feed: "\u000A":

$C_First_Name + "\u000A" + $C_Last_Name 

This works for all three formats:

No comments:

Post a Comment