For additional information on inserting headers and footers, see Defining Headers and Footers. Additional formatting and reporting features are described at the end of this section. You add markup to create the mapping between your layout and the XML file and to include features that cannot be represented directly in your format.
The most basic markup elements are placeholders, to define the XML data elements; and groups, to define the repeating elements. The placeholder maps the template field to the XML element data field.
Note: The placeholder must match the XML element tag name exactly. It is case sensitive. This method allows you to maintain the appearance of your template. In your document, enter:. Select the Text Form Field toolbar icon. This action inserts a form field area in your document. Optional Enter a description of the field in the Default text field. The entry in this field will populate the placeholder's position on the template.
In the Form Field Help Text field enter:. The text entry field on the Help Key F1 tab allows more characters. The following table shows the entries made to complete the example. The Template Field Name is the display name from the template. The following figure shows the Payables Invoice Register with the completed form field placeholder markup.
By defining a group, you are notifying BI Publisher that for each occurrence of an element, you want the included fields displayed. To designate a group of repeating fields, insert the grouping tags around the elements to repeat. If you insert the grouping tags around text or formatting elements, the text and formatting elements between the group tags will be repeated.
If you insert the tags around text in a table cell, the text in the table cell between the tags will be repeated. If you insert the tags around two different table cells, but in the same table row, the single row will be repeated. If you insert the tags around two different table rows, the rows between the tags will be repeated this does not include the row that contains the "end group" tag.
To create the Suppliers group in the example, insert a form field before the Suppliers field that you previously created. In the help text field enter:. For the example, enter the Default text "Group: Suppliers" to designate the beginning of the group on the template.
The Default text is not required, but can make the template easier to read. Insert a form field after the final placeholder element in the group.
For the example, enter the Default text "End: Suppliers" after the summary row to designate the end of the group on the template. The following figure shows the template after the markup to designate the Suppliers group was added.
The second group in the example is the invoices group. The repeating elements in this group are displayed in the table. For each invoice, the table row should repeat. Create a group within the table to contain these elements. Note: For each invoice, only the table row should repeat, not the entire table. Placing the grouping tags at the beginning and end of the table row will repeat only the row.
If you place the tags around the table, then for each new invoice the entire table with headings will be repeated. Enter the Default text "Group:Invoices" to designate the beginning of the group. Insert the end tag inside the final table cell of the row after the Accounted Amt placeholder.
Enter the Default text "End:Invoices" to designate the end of the group. To create a header or footer, use the your word processing application's header and footer insertion tools. As an alternative, or if you have multiple headers and footers, you can use start:body and end body tags to distinguish the header and footer regions from the body of your report.
At the time of this writing, Microsoft Word does not support form fields in the header and footer. If your template requires multiple headers and footers, create them by using BI Publisher tags to define the body area of your report. You may also want to use this method if your header and footer contain complex objects that you wish to place in form fields. When you define the body area, the elements occurring before the beginning of the body area will compose the header.
The elements occurring after the body area will compose the footer. However, if you wanted to add another header to the template, define the body area as follows:. If your report requires a different header and footer on the first page of your report; or, if your report requires different headers and footers for odd and even pages, you can define this behavior using Microsoft Word's Page Setup dialog.
Enter the following syntax in the Alternative text region to reference the image URL:. You can also build a URL based on multiple elements at runtime. Just use the concat function to build the URL string. For example:. If your data source is a Data Template for information, see Data Templates and your results XML contains image data that had been stored as a BLOB in the database, use the following syntax in a form field inserted in your template where you want the image to render at runtime:.
Note that you can specify height and width attributes for the image to set its size in the published report. BI Publisher will scale the image to fit the box size that you define. For example, to set the size of the example above to three inches by four inches, enter the following:.
The following summarizes the steps to add a chart to your template. These steps will be discussed in detail in the example that follows:. Add the definition for the chart to the Alternative text box of the dummy image. The chart definition requires XSL commands. At runtime BI Publisher calls the BI Beans applications to render the image that is then inserted into the final output document.
This example will show how to insert a chart into your template to display it as a vertical bar chart as shown in the following figure:. The first step is to add a dummy image to the template in the position you want the chart to appear.
The image size will define how big the chart image will be in the final document. Important: You must insert the dummy image as a "Picture" and not any other kind of object.
The image can be embedded inside a for-each loop like any other form field if you want the chart to be repeated in the output based on the repeating data. In this example, the chart is defined within the sales year group so that a chart will be generated for each year of data present in the XML file. Right-click the image to open the Format Picture palette and select the Web tab. Use the Alternative text entry box to enter the code to define the chart characteristics and data definition for the chart.
The content of the Alternative text represents the chart that will be rendered in the final document. For this chart, the text is as follows:. The first element of your chart text must be the chart: element to inform the RTF parser that the following code describes a chart object.
This element has an attribute to define the chart type: graphType. If this attribute is not declared, the default chart is a vertical bar chart. BI Beans supports many different chart types. Several more types are presented in this section.
All of these values can be declared or you can substitute values from the XML data at runtime. For example, you can retrieve the chart title from an XML tag by using the following syntax:.
Note that the tag name is enclosed in curly braces. These define the number of columns and rows that will be shown at runtime. In this example, a count function calculates the number of columns to render:. The rowCount has been hard-coded to 1. This value defines the number of sets of data to be charted. In this case it is 1.
Next the code defines the row and column labels. These can be declared, or a value from the XML data can be substituted at runtime. The column labels for this example are derived from the data: Groceries, Toys, Cars, and so on. This is done using a for-each loop:.
At runtime, this will generate the following XML:. Similar to the labels section, the code loops through the data to build the XML that is passed to the BI Beans rendering engine. This will generate the following XML:.
The following example shows total sales and cost of sales charted in a horizontal bar format. To accommodate the second set of data, the rowCount attribute for the LocalGridData element is set to 2. There are many attributes available from the BI Beans graph DTD that you can manipulate to change the look and feel of your chart. For example, the previous chart can be changed to remove the grid, place a graduated background, and change the bar colors and fonts as shown in the following figure:.
The colors for the bars are defined in the SeriesItems section. The colors are defined in hexadecimal format as follows:. The PlotArea section defines the background. The SFX element establishes the gradient and the borderTransparent attribute hides the plot border:. BI Publisher supports Microsoft Word drawing, shape, and clip art features.
You can add these objects to your template and they will be rendered in your final PDF output. Connectors - straight connectors only are supported.
Curved connectors can be achieved by using a curved line and specifying the end styles to the line. Use the freehand drawing tool in Microsoft Word to create drawings in your template to be rendered in the final PDF output. You can add hyperlinks to your shapes. See Hyperlinks. You can layer shapes on top of each other and use the transparency setting in Microsoft Word to allows shapes on lower layers to show through.
The following graphic shows an example of layered shapes:. Use the equation editor to generate equations in your output. The following figure shows an example of an equation:. Use the organization chart functionality in your templates and the chart will be rendered in the output. The following image shows an example of an organization chart:.
You can use Microsoft Word's WordArt functionality in your templates. The following graphic shows a WordArt example:. To use the unsupported WordArt in your template, you can take a screenshot of the WordArt then save it as an image gif, jpeg, or png and replace the WordArt with the image.
In addition to supporting the static shapes and features in your templates, BI Publisher supports the manipulation of shapes based on incoming data or parameters, as well. The following manipulations are supported:. These manipulations not only apply to single shapes, but you can use the group feature in Microsoft Word to combine shapes together and manipulate them as a group.
Enter manipulation commands for a shape in the Web tab of the shape's properties dialog as shown in the following example figure:. You can replicate a shape based on incoming XML data in the same way you replicate data elements in a for-each loop. To do this, use a for-each shape command in conjunction with a shape-offset declaration. For example, to replicate a shape down the page, use the following syntax:.
The XSL position command returns the record counter in the group that is 1,2,3,4 ; one is subtracted from that number and the result is multiplied by And for each subsequent occurrence the offset would be another pixels down the page.
You can add text to a shape dynamically either from the incoming XML data or from a parameter value. In the property dialog enter the following syntax:. At runtime the text will be inserted into the shape. You can add text along a line or curve from incoming XML data or a parameter. After drawing the line, in the property dialog enter:. You can move a shape or transpose it along both the x and y-axes based on the XML data. For example to move a shape pixels along the y-axis and along the x-axis, enter the following commands in the property dialog of the shape:.
ANGLE is the number of degrees to rotate the shape. If the angle is positive, the rotation is clockwise; if negative, the rotation is counterclockwise. Valid values are combinations of left, right, or center with center, top, or bottom. The following figure shows these valid values:. ANGLE is the number of degrees to skew the shape. If the angle is positive, the skew is to the right. See the figure under Rotating a Shape.
For example, to skew a shape by 30 degrees about the bottom right hand corner, enter the following:. You can change the size of a shape using the appropriate commands either along a single axis or both axes. To change a shape's size along both axes, use:. Therefore a value of 2 would generate a shape twice the height and width of the original. A value of 0. Changing only the x or y value has the effect of stretching or shrinking the shape along an axis.
This can be data driven. You can also combine these commands to carry out multiple transformations on a shape at one time. For example, you can replicate a shape and for each replication, rotate it by some angle and change the size at the same time. The following example shows how to replicate a shape, move it 50 pixels down the page, rotate it by five degrees about the center, stretch it along the x-axis and add the number of the shape as text:. This example demonstrates how to set up a template that will generate a star-rating based on data from an incoming XML file.
Using this data element and the shape manipulation commands, we can create a visual representation of the ratings so that the reader can compare them at a glance. The form fields hold the simple element values. The only difference with this template is the value for the star shape. The replication command is placed in the Web tab of the Format AutoShape dialog. In the for-each shape command we are using a command to create a "for The output from this template and the XML sample is shown in the following graphic:.
This example shows how to combine shapes into a group and have them react to the incoming data both individually and as a group. Assume the following XML data:.
You can create a visual representation of this data so that users can very quickly understand the sales data across all regions. Do this by first creating the composite shape in Microsoft Word that you wish to manipulate. The following figure shows a composite shape made up of four components:. The shape consists of three cylinders: red, yellow, and blue. These will represent the data elements software, hardware, and services.
The combined object also contains a rectangle that is enabled to receive text from the incoming data. The value is divided by to set the stretch or shrink factor. For example, if the value is , divide that by to get a factor of 2.
The shape will generate as twice its current height. All of these shapes were then grouped together and in the Web tab for the grouped object, the following syntax is added:. In this set of commands, the for-each shape loops over the SALE group.
The shape-offset command moves the next shape in the loop to the right by a specific number of pixels. The expression position -1 sets the position of the object. Subsequent occurrences would be rendered at a pixel offset along the x-axis to the right. At runtime three sets of shapes will be rendered across the page as shown in the following figure:. To make an even more visually representative report, these shapes can be superimposed onto a world map.
Just use the "Order" dialog in Microsoft Word to layer the map behind the grouped shapes. Microsoft Word Users : After you add the background map and overlay the shape group, use the Grouping dialog to make the entire composition one group.
Using this option removes the need to do the final grouping of the map and shapes. We can now generate a visually appealing output for our report as seen in the following figure:. In addition to the features already listed, BI Publisher supports the following features of Microsoft Word. To insert a page break, insert a Ctrl-Enter keystroke just before the closing tag of a group.
For example if you want the template to start a new page for every Supplier in the Payables Invoice Register:. Using this Microsoft Word native feature will cause a single blank page to print at the end of your report output.
To avoid this single blank page, use BI Publisher's page break alias. See Special Features: Page Breaks. Insert page numbers into your final report by using the page numbering methods of your word processing application.
For example, if you are using Microsoft Word:. You can format text as "hidden" in Microsoft Word and the hidden text will be maintained in RTF output reports. You can align any object in your template using your word processing application's alignment tools. This alignment will be reflected in the final report output. If your data is displayed in a table, and you expect the table to extend across multiple pages, you can define the header rows that you want to repeat at the start of each page.
Prevent rows from breaking across pages. If you want to ensure that data within a row of a table is kept together on a page, you can set this as an option using Microsoft Word's Table Properties. Fixed-width columns. Enable the Preferred width checkbox and then enter the width as a Percent or in Inches.
By default, if the text within a table cell will not fit within the cell, the text will be wrapped. To truncate the text instead, use the table properties dialog. Right-click your mouse and select Table Properties From the Table Properties dialog, select the Cell tab, then select Options Insert dates using the date feature of your word processing application. Note that this date will correspond to the publishing date, not the request run date.
BI Publisher supports Microsoft Word's Columns function to enable you to publish your output in multiple columns on a page. The following graphic shows the Columns dialog:. Define the repeatable group in the first column. Note that you define the repeatable group only in the first column, as shown in the following figure:. Tip: To prevent the address block from breaking across pages or columns, embed the label block inside a single-celled table.
Then specify in the Table Properties that the row should not break across pages. See Prevent rows from breaking across pages. You can specify a single, graduated color or an image background for your template to be displayed in the PDF output.
Note that this feature is supported for PDF output only. Select Fill Effects to open the Fill Effects dialog. The Fill Effects dialog is shown in the following figure:. Text Watermark - use the predefined text options or enter your own, then specify the font, size and how the text should be rendered.
To create a page break after the occurrence of a specific element use the "split-by-page-break" alias. This will cause the report output to insert a hard page break between every instance of a specific element.
In the Help Text of this form field enter the syntax:. In the template sample shown in the following figure, the field called PageBreak contains the split-by-page-break syntax:.
This will ensure a page break is inserted before the occurrence of each new supplier. This method avoids the ejection of an extra page at the end of the group when using the native Microsoft Word page break after the group.
Some reports require that the initial page number be set at a specified number. For example, monthly reports may be required to continue numbering from month to month.
BI Publisher allows you to set the page number in the template to support this requirement. Note: You must first declare the parameter in your template. See Defining Parameters in Your Template. BI Publisher supports the Microsoft Word functionality to specify a different page layout for the first page, odd pages, and even pages.
To implement these options, simply select Page Setup from the File menu, then select the Layout tab. BI Publisher will recognize the settings you make in this dialog. However, Microsoft Word does not provide settings for a different last page only. This is useful for documents such as checks, invoices, or purchase orders on which you may want the content such as the check or the summary in a specific place only on the last page.
Create a section break in your template to ensure the content of the final page is separated from the rest of the report. Any content on the page that occurs above or below these two tags will appear only on the last page of the report. Also, note that because this command explicitly specifies the content of the final page, any desired headers or footers previously defined for the report must be reinserted on the last page.
This example uses the last page only feature for a report that generates an invoice listing with a summary to appear at the bottom of the last page. The template for this is shown in the following figure:. Insert a Microsoft Word section break type: next page on the first page of the template. For the final page, insert new line characters to position the summary table at the bottom of the page. The summary table is shown in the following figure:. Any content above or below this statement will appear on the last page only.
The content above the statement is regarded as the header and the content below the statement is regarded as the footer. If your reports contains headers and footers that you want to carry over onto the last page, you must reinsert them on the last page. For more information about headers and footers see Defining Headers and Footers. You must insert a section break type: next page into the document to specify the last page layout.
It is important to note that if the report is only one page in length, the first page layout will be used. If your report requires that a single page report should default to the last page layout such as in a check printing implementation then you can use the following alternate syntax for the "Last Page Placeholder" on the last page:.
Most popular file formats If we miss any, let us know! We care for our content. All files are safe from viruses and adults-only content. Video files A great collection of video files for testing and demo use.
Audio files Do you need mp3, wav or other audio format for testing? Documents A set of document files: doc, docx, odt, pdf, xls, ppt, pps and more. Images A stock of images for testing. The Template Builder is tightly integrated with Microsoft Word and enables you to perform the following functions:. Note that the Template Builder automates insertion of the most frequently used components of an RTF template. RTF templates also support much more complex formatting and processing.
Your Template Builder installation provides samples and demo files to help you get started. The demos can be accessed from your Windows Start menu as follows:. Report Demo - demonstrates building a report layout using many key features of the Template Builder, including: connecting to the BI Publisher server, loading data for a report, inserting tables and charts, and defining conditional formatting.
Invoice Demo - demonstrates how to take a prepared layout and use the Template Builder to insert the required fields to fill the template with data at runtime. The Samples folder contains three subfolders:. The eText and PDF template samples can be used as references to create these types of templates. The RTF templates folder contains eight subfolders to provide samples of different types of reports.
Refer to the TrainingGuide. Your report data model has been created and runs successfully. Note: See System Requirements and Certification for the most up-to-date information on supported hardware and software. For versions of Microsoft Word prior to the menu and toolbar will appear as shown in the following figure:. You can build and upload your template via a direct connection with the BI Publisher server, or you can build and upload your template in disconnected mode.
Contact your system administrator if you do not know the URL. Select the report or data model for which you want to build a template. This is the report you will upload your template to. Follow the guidelines in this chapter to insert data fields and design your template using features such as tables, charts, and graphics.
Use Microsoft Word to apply formatting to fonts and other objects in your template. Enter a name and select a locale in the Upload as New dialog. Note that this is the name that appears under Layouts in the Report Editor. This is also the layout name that will be displayed when a user runs this report. Navigate to the BI Publisher report editor to configure properties for this layout, such as output formats. See Configuring Layouts for more information.
To work in disconnected mode, you must have a sample data file available in your local work environment:. Save a sample data file to your local machine. Locate your sample data file in your local directory and click Open. However, because the schema contains no data, the preview of your report will also contain no data.
Follow the guidelines in this chapter to insert data fields and design your template using features such as tables, charts, graphics, and other layout components.
Complete the fields in the dialog and then select Upload. The template will now appear as a layout for the report. The Template Builder requires sample data to build your template. You must load sample data to use most of the template builder functionality. One method of loading data to the Template Builder is to save a sample of your report data to a local directory. If you do not have access to the report data model, but you can access the report, you can alternatively save sample data from the report viewer.
To save data from the report viewer:. Click the Actions icon, then click Export , then click Data. You will be prompted to save the XML file. Sample XML - This function allows you to load a sample XML file that contains all fields that you want to insert into your template as a data source. If you are not connected to the BI Publisher server, use this method to load your data.
The XML schema has the advantage of being complete a sample XML file may not contain all the fields from the data source. However, the preview works better if you also upload real sample data.
You can also download an existing template to modify it. Navigate to the folder that contains the report or data model for which you want to create a template. This dialog enables you to select data elements from the data source and insert them into the template. In the Insert group select Field to open the Field dialog. The dialog shows the structure of your loaded data source in a tree view, as shown in the following figure:.
Select a field that represents a single data field a leaf node of the tree and select Insert you can also insert the field by dragging and dropping it into your document, or by double-clicking the field. A text form field with hidden BI Publisher commands is inserted at the cursor position in the template. You may either select and insert additional data fields or close the dialog by clicking the Close button.
For an XML document with a large and complicated structure, use the find functionality to find a specific field. Enter a partial string of the field name you are searching into the Find field and click Find Next.
The next occurrence of a data element that includes your search expression will be selected. Click the Find Next button again to see the next occurrence. This check box is only needed if you are using the template in a language that prints the characters from right to left, such as Arabic or Hebrew. Use this feature to force left-to-right printing for fields such as phone numbers, addresses, postal codes, or bank account numbers.
This feature enables you to perform aggregation functions on data fields, such as sum, average, count, minimum, and maximum. For example, if you select sum for a data field, the field will show the sum of all occurring values for this data field, depending on the grouping. It is important to understand the grouping context marked by G and E form fields to know exactly which fields are accumulated.
If you insert a data field with an accumulation function into a repeating section marked by G and E processing instruction form fields , you must select On Grouping to accumulate the data for the occurrences within the group. If you do not want the accumulation to be restricted to the group, you must place the accumulation field outside the group.
Also note that the data field must be a valid XSL number for the accumulation functions to work. Formatted numbers cannot be processed by BI Publisher for example a number using a thousands separator: 10,, For more information on groups in your template using the Template Builder, see Inserting a Repeating Group.
The Insert Table Wizard enables you to create standard reports. On the Insert menu select Table Wizard. Start by selecting the basic report format.
Choose from Table , Form , or Free Form. The following example shows how the each selection will appear in the report. The following figure shows examples of each:. An XML document can include multiple grouped data sets. For example, a purchase order XML document may contain header level information, lines, shipments and contacts. Select the group that contains the data fields for your table.
Use the shuttle buttons to select the data fields to show in your table. Use the up and down arrows to reorder the fields after selecting them. For example, if you are building a table of invoices, you may want to group all invoices of a particular type or date to be grouped together in the report.
There are two options for grouping: Group Left or Group Above. Group Left will create a nested table. The Group By field will display to the left in the outer table. Group Above will create a new table for each new value of your group by field, displaying the value of the group by field as a table title.
When you select an element to group by, BI Publisher sorts the data by the grouping element. If the data is already sorted by the grouping element, select the Data already sorted check box.
This will improve performance. Use the Break option to insert either a Page break or Section break after each occurrence of this group. Note that a Section break can only be created on the top-level group. The subsequent grouping options only display the Page break option. Note that a page break will start the next group on a new page; a section break will start the next group on a new page, reset page numbering, reset headers and footers, and reset any running calculations for each occurrence of the group.
You can sort the data in the table by up to four different fields. Select a field and then define the sorting order ascending or descending , and select the correct data type for the field. Customize the table by changing fonts, colors, column sizing, borders, shading, and so on, using Microsoft Word formatting commands. It allows you to perform the following tasks:. Associate a group of data elements, such as a complete invoice or a purchase order line, with a form in the document that will be repeated for each occurrence of the data element.
The left pane shows the data source structure, while the right pane shows the elements that will be copied to the template when you click the Insert button. First select the data fields to insert in the template and then define how to format them. If the XML element has children, you will see a pop-up menu with the following options:. Select Drop Single Node if you want to move only the selected node or Drop All Nodes if you want to move the node and all its children.
If you drag an additional data field from the left Data Source pane to the right Template pane, it is either inserted at the same level Same Level or below the node Child where you release the node. The Insert Position box defines where the node is inserted. Note: If you use the left mouse button for drag and drop, the node and all children are copied. However, if you use the right mouse button for dragging, a dialog pops up when you release the mouse button.
The dialog gives you the option to copy either only the selected node or the selected node and all children. When you select an element in the right Template pane, you will see its properties as well as a preview of how the node will be rendered. There are two kinds of nodes:. Data Field nodes leaf nodes do not have any child nodes. They represent simple attributes such as the total amount for an invoice or the subtotal for a purchase order line.
Data Group nodes parent nodes are nodes that do have child nodes. Typically, they do not represent data attributes, but groups of data — such as an invoice, a purchase order, a purchase order line or a shipment.
If a Data Field node is selected, its properties are shown in the Properties pane. You have the following options to describe how the Template Builder should show the field:. You can select one of the aggregation functions for the data fields. These functions besides count only have an effect when there is more than one of the data fields in the context where you use the function.
0コメント