Outline:
BIP Template Insert Menu Examples (Using Real Data)
- Field
- Table/Form or Table Wizard
- Table/Form – Setting up and Formatting
- Table Wizard – Four formatting examples
BIP Template – Insert Menu > Field, Table Wizard, Table/Form
Examples
The first three choices on the BI Publisher Word Template Insert Menu are Field, Table Wizard and Table/Form. These sub-menus/dialogs are the means by which you begin to populate the template with the fields from your query. Below are illustrations of working with each of these selections to create your report.
Real Data: Note that to better illustrate how the final text will appear, the data in the following examples are derived from an XML file saved directly from Query, i.e., the Report Definition Data Source has not yet been created.
The data appearing in the previews are real data saved in the XML File.
This is not “live” data, i.e. this is the output of a query as it existed at the point in time that the query was downloaded to XML.
Important: The data you see in the Template are not connected to PS Query.
You can read more about using real data in BI Publisher Templates here:
- FAQs about Using Real Data When Designing and Previewing Your BI Publisher Word Template
- BI Publisher Tutorial Lesson 2 – Create, Format and View a Simple Report – Using Real Data
1 Field:
In this example, the Add-Ins > Insert > Field dialog is used, and three fields are added to the page, i.e. you select the data 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 in a tree view, as shown here:
The Insert Field dialog fields are:
- Find
- 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.
- Example
- When you select a field name in the tree view, an example value for this field is shown.
- Force LTR (Left-to-Right) Direction
- 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.
- Calculation
- 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.
- Review Example 3 Insert Table/Form – Setting Up and Formatting below about working with Grouping.
- For two simple examples of calculations, read How to Calculate on One Field – Counting and How to Create a Group and Aggregate Specified Fields.
To place the fields on the page, use one of these three methods:
- Drag and drop each field from the list to the desired location
- Double-click each field after placing the cursor at each location
- Place the cursor where you would like the fields to be placed and then click the Insert button.
Three “text form fields” with hidden BI Publisher commands are 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.
The three text form fields, EXT_ORG_ID, DESCR50, and STATE, appear in the document as shown here:
BI Publisher Properties:
- You can look at the BI Publisher Properties/Commands for a field if you double-click on the field, for example, EXT_ORG_ID.
- The BI Publisher Properties dialog box opens.
- You’ll first see the Properties page. You can make formatting edits and perform other functions on this page.
- If you click on the Advanced tab, you will see the method BI Publisher uses to frame the fields.
- As explained in an article entitled XMLP Templates by Example, the <?EXT_ORG_ID?> code tells the BIP “template parser that the (EXT_ORG_ID) element should be inserted into the final document using ‘<?’ and ‘?>’ to delimit the element mapping.”
Preview (as a PDF) and Save (as an RTF):
To preview how the fields will appear on the page, do the following.
- Click on Add-Ins > Preview PDF.
- The first time you do so, the following dialog box will pop up. This box will open no matter which choice you make from the Preview Menu.
- Click the OK button and save the template as an RTF file in an appropriate directory. After doing so, the sample PDF file will open.
Preview (real data):
- NOTE: As mentioned above, the data in the examples shown here are derived from an XML file saved directly from Query.
- The Report Definition Data Source has not yet been created.
- The data appearing in the previews are real data saved in the XML File.
- The data are not connected to PS Query.
- The only text appearing on the page at this point is the text related to the three fields for the first organization on the list:
Preview (Data Source – Sample Data):
- Once the Data Source is created and associated with the Template, the output in the Preview would appear as follows:
2 Table/Form or Table Wizard:
Go to top
This example will demonstrate how using the Table/Form or Table Wizard menu items will aid in setting up a looping process to present the list of Organizations. This can be accomplished through the use of Add-Ins > Insert > Table/Form or Add-Ins >Insert > Table Wizard.
A typical example of a table created using the Table/Form or Table Wizard with the three fields shown in the first example would be the following.
NOTE: To see how a similar a table was created using the Table Wizard, take a look at Table Wizard Example 2
In addition to the three fields previously used, there are two other fields – “F” and “E” – at the beginning and end of the row.
F Code: <?for-each:row?>
If you double-click on the “F,” you will see the following dialog which has the code <?for-each:row?> on the Advanced page. It is saying “perform the following process for each part of the row, i.e. enter the three fields of EXT_ORG_ID, DESCR50, and STATE.”
E Code <?end for-each?>:
If you double-click on the “E,” you will see this dialog box which has one page only. The <?end for-each?> command closes the loop.
3 Insert Table/Form – Setting Up and Formatting
(To read more on formatting, visit the BIP – Formatting page.)
This document is a demonstration of setting up and formatting a Word Template RTF file for BI Publisher using the Table/Form dialog box. There are examples of BI Publisher properties such as Grouping and “for-each” code, and how to use MS Word tools to edit and change the appearance of the output in a few different ways.
Data as first displayed:
Final display of data:
You can expand on these basic features, for example, by grouping the rows in various ways, performing calculations, doing conditional formatting, and performing a number of other functions to enhance the usability of your document.
Insert Table Wizard – Four Formatting Examples
The following four illustrations demonstrate some of the possible formats available using the Table Wizard dialog box without making any other edits. When you select the Table Wizard option, you are stepped through six Table Wizard dialog boxes that guide you through choosing:
- Report Format (table, form or free form)
- Grouping field to report on
- Which fields to show
- Report grouping
- Sorting of fields
- Labels for fields
These are the final formats for each of the four examples. Click on the link to look at how each outcome was reached:
Table Wizard Example 1 |
Table Wizard Example 2 |
Table Wizard Example 3 |
Table Wizard Example 4 |