
Tips Recipes Brio 2002
Copyright © 2002, Brio Software Page 61
Section Type: Report section
Tip Name: Multi-Line fields (using JavaScript codes for new line)
Purpose / Use: To create a single text object that wraps at a pre-determined point in the
text, not simply when the width of the text object has been exceeded. In
this example, we want the various query limits of the report displayed.
Sample File: Multi-line fields.bqy
Steps to Produce: Use the special JavaScript codes for carriage return and new line as part
of the text object’s formula.
1) Create a header by selecting Report | Headers and Footers | Page Header.
2) Drag one or more field objects directly into the report header area (instead of into the
Table Outliner). This will create text objects with the correct JavaScript code to display
the selected query limit. For our example, click on the plus sign next to “Fields” in the
catalogue, and drag Query Limit into the page header. Do this once each for Product
Line, Region and Year. Each object will include the name of the field, and its current limit
setting.
3) Click on the Product Line object in the page header. Add a colon to the text in the front of
the formula, so that it now reads “Product Line: “.
4) At the end of the formula, add a + sign, and the text for the JavaScript codes for carriage
return and new line, which are “\r\n”. The formula for the Product Line object should
now look like this:
"Product Line: " + ServerLimitValues("Query", "Product
Line", "", ",")+"\r\n”
5) Select the Region object, and use the Ctrl-C key combination to copy its formula to the
Windows clipboard.
6) Select the Product Line object, go to the end of the formula text, and then hit Ctrl-V to
paste in the formula for Region. Edit the formula so it now reads:
"Product Line: " + ServerLimitValues("Query", "Product
Line", "", ",")+"\r\nRegion: " + ServerLimitValues("Query",
"Region", "", ",")
Comentarios a estos manuales