Step 1 — Define Data Template Create a data definition with below code:. LOG, 'Dept No. Note: In Data template when you define default Package, its mandatory to declare all the parameters of concurrent program as global variable in the default package.
Step 3 — Define concurrent program. Step 4 — Define Data Definition and Template. User insert all fields option in XMLP addon to insert all fields in rtf layout. Preview to see the output:. Click here to download RTF, Data template and package used in this article. The default value is This is required when processing a large volume of data.
Valid values: on off default. Attribute Name Description name required The parameter name that will be referenced in the template. DNAME , d. LOG , 'Dept No. Please send me the below to arunraj at quest4apps. For me also same error can u pls help me saikumar gmail. Hi your blog provided information is very impressive. I had got some doubt. I will send screenshot what I got.
Please provide email id.. Thanks for the kind words. Send me an email at arunraj quest4apps. Also include the RTF template and the sample xml file. You are correct. Do Data template file need any file changes for saving it as. While Data definition creation, which file should be uploaded?
I tried copying XML data template and saved it as. None was right. Could you please help. Has this been fixed? If not please feel free to email me arun. I am facing another issue could You please suggest if :: oracle. PostProcessorException: oracle. If you are still facing the issue, email me arun.
Sir, I am using a before report trigger to update the parameter scenario: if no value is passed to parameter a default parameter to be assigned. The updated parameter value is not reflecting in data template. Please reply what to do.
The file will look as shown below: Open Word. If the data is loaded successfully, you will get the below message: Click OK and to Continue. We will be getting the below screen: Press OK. Go to Data Templates and create a new Data Template. Give the following details: Select the Data Definition that we had created prior to this.
Create a new Concurrent Program and give the following details. Click on Parameters and give the following details: Assign the program to the request group and run the program. Like this: Like Loading Related Articles. Thats a good work…Keep going.. 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:.
Substituting this syntax will result in the last page layout for reports that are only one page long. If your report has different odd and even page layouts, you may want to force your report to end specifically on an odd or even page. Or, you may have binding requirements to have your report end on an even page, without specific layout.
If you do not have layout requirements for the final page, but would like a blank page ejected to force the page count to the preferred odd or even, use the following syntax:. BI Publisher supports several different types of hyperlinks. The hyperlinks can be fixed or dynamic and can link to either internal or external destinations. Hyperlinks can also be added to shapes. To insert static hyperlinks to either text or a shape, use your word processing application's insert hyperlink feature:.
Use the right-mouse menu to select Hyperlink ; or, select Hyperlink from the Insert menu. The following screenshot shows the insertion of a static hyperlink using Microsoft Word's Insert Hyperlink dialog box. If your input XML data includes an element that contains a hyperlink or part of one, you can create dynamic hyperlinks at runtime. In the Type the file or Web page name field of the Insert Hyperlink dialog box, enter the following syntax:.
The following figure shows the insertion of a dynamic hyperlink using Microsoft Word's Insert Hyperlink dialog box. This link may render as:. Use the right-mouse menu to select Hyperlink ; or select Hyperlink from the Insert menu. Follow your word processing application's procedures for inserting a table of contents.
BI Publisher also provides the ability to create dynamic section headings in your document from the XML data. You can then incorporate these into a table of contents. Enter a placeholder for the heading in the body of the document, and format it as a "Heading", using your word processing application's style feature. You cannot use form fields for this functionality. For example, you want your report to display a heading for each company reported.
Now format the text as a Heading. If you have defined a table of contents in your RTF template, you can use your table of contents definition to generate links in the Bookmarks tab in the navigation pane of your output PDF. The bookmarks can be either static or dynamically generated.
For information on creating the table of contents, see Table of Contents. You can include a check box in your template that you can define to display as checked or unchecked based on a value from the incoming data.
Position the cursor in your template where you want the check box to display, and select the Check Box Form Field from the Forms tool bar shown in the following figure.
In the Form Field Help Text dialog, enter the criteria for how the box should behave. This must be a boolean expression that is, one that returns a true or false result.
Enter the following in the help text field:. Note that you do not have to construct an "if" statement. The expression is treated as an "if" statement. BI Publisher allows you to use the drop-down form field to create a cross-reference in your template from your XML data to some other value that you define in the drop-down form field. You can then display the name in your published report.
Position the cursor in your template where you want the value from the drop-down list to display, and select the Drop-Down Form Field from the Forms tool bar shown in the following figure.
Add each value to the Drop-down item field and the click Add to add it to the Items in drop-down list group. The values will be indexed starting from one for the first, and so on. For example, the list of continents will be stored as follows:. Now use the Help Text box to enter the XML element name that will hold the index for the drop-down field values.
Using the check box and drop-down list features, you can create a report to display population data with check boxes to demonstrate figures that reach a certain limit. An example is shown in the following figure:. Conditional formatting occurs when a formatting element appears only when a certain condition is met.
BI Publisher supports the usage of simple "if" statements, as well as more complex "choose" expressions. For example, you can specify that if reported numbers reach a certain threshold, they will display shaded in red. Or, you can use this feature to hide table columns or rows depending on the incoming XML data. Use an if statement to define a simple condition; for example, if a data field is a specific value.
This example is displayed in the figure below. Note that you can insert the syntax in form fields, or directly into the template. To achieve this requirement, you must use the BI Publisher context command to place the if statement into the inline sequence rather than into the block the default placement. Note: For more information on context commands, see Using Context Commands. To specify that the if statement should be inserted into the inline sequence, enter the following:.
BI Publisher supports the common programming construct "if-then-else". This is extremely useful when you need to test a condition and conditionally show a result. If the value is greater than , show the word "Higher"; if it is less than , show the word "Lower"; if it is equal to , show "Equal":. Use the choose, when, and otherwise elements to express multiple conditional tests.
If certain conditions are met in the incoming XML data then specific sections of the template will be rendered. This is a very powerful feature of the RTF template. In the template, however, you can actually use visual widgets in the conditional flow in the following example, a table.
Otherwise, the row of data will render with no shading. In the following figure, the form field default text is displayed. The form field help text entries are shown in the table following the example. You can conditionally show and hide columns of data in your document output. The following example demonstrates how to set up a table so that a column is only displayed based on the value of an element attribute.
Notice the type attribute associated with the items element. For the "public" version of the list we do not want to show the quantity column in the output, but we want to develop only one template for both versions based on the list type. The following figure is a simple template that will conditionally show or hide the quantity column:. The conditional column syntax is the "if" statement syntax with the addition of the column clause.
It is the column clause that instructs BI Publisher to hide or show the column based on the outcome of the if statement. If you did not include the column the data would not display in your report as a result of the if statement, but the column still would because you had drawn it in your template. Note: The column clause is an example of a context command.
For more information, see Using Context Commands. BI Publisher allows you to specify formatting conditions as the row-level of a table. Examples of row-level formatting are:. This is demonstrated in the following sample template. This example demonstrates how to set a background color on every other row. The template to create this effect is shown in the following figure:.
In the preceding example, note the "format;" field. It contains an if statement with a "row" context row. This sets the context of the if statement to apply to the current row. This will result in the following output:. Note: For more information about context commands, see Using Context Commands. The following example demonstrates how to conditionally highlight a cell based on a value in the XML file. The template lists the accounts and their credit and debit values.
In the final report we want to highlight in red any cell whose value is greater than The "if" statement is testing if the debit value is greater than If it is, then the next lines are invoked. Notice that the example embeds native XSL code inside the "if" statement. The xdofo:ctx component is an BI Publisher feature that allows you to adjust XSL attributes at any level in the template.
In this case, the background color attribute is changed to red. To change the color attribute, you can use either the standard HTML names for example, red, white, green or you can use the hexadecimal color definition for example, FFFFF. BI Publisher allows you to display calculated page totals in your report. Because the page is not created until publishing time, the totaling function must be executed by the formatting engine. Note: Page totaling is performed in the PDF-formatting layer.
Note: Note that this page totaling function will only work if your source XML has raw numeric values. The numbers must not be preformatted. Because the page total field does not exist in the XML input data, you must define a variable to hold the value. When you define the variable, you associate it with the element from the XML file that is to be totaled for the page. Once you define total fields, you can also perform additional functions on the data in those fields. To declare the variable that is to hold your page total, insert the following syntax immediately following the placeholder for the element that is to be totaled:.
Oracle-number-format is the format you wish to use to for the display, using the Oracle format mask for example: C9GD The following example shows how to set up page total fields in a template to display total credits and debits that have displayed on the page, and then calculate the net of the two fields. Note that on the field defined as "net" we are actually carrying out a calculation on the values of the credit and debit elements. Now that you have declared the page total fields, you can insert a field in your template where you want the page totals to appear.
Reference the calculated fields using the names you supplied in the example, ct and dt. The syntax to display the page totals is as follows:. Therefore to complete the example, place the following at the bottom of the template page, or in the footer:. Many reports require that a page total be maintained throughout the report output and be displayed at the beginning and end of each page.
Note: The totaling for the brought forward and carried forward fields is performed in the PDF-formatting layer. At the end of the first page, the page total for the Amount element is displayed as the Carried Forward total.
At the top of the second page, this value is displayed as the Brought Forward total from the previous page. At the bottom of the second page, the brought forward value plus the total for that page is calculated and displayed as the new Carried Forward value, and this continues throughout the report. This functionality is an extension of the Page Totals feature.
The following example walks through the syntax and setup required to display the brought forward and carried forward totals in your published report.
The following sample template creates the invoice table and declares a placeholder that will hold your page total:. To display the brought forward total at the top of each page except the first , use the following syntax:. This is an optional property that takes one of the following values:. In this example, display-condition is set to "exceptfirst" to prevent the value from appearing on the first page where the value would be zero. This property is optional, but if you want to supply a format mask, you must use the Oracle format mask.
For more information, see Using the Oracle Format Mask. Insert the brought forward object at the top of the template where you want the brought forward total to display.
If you place it in the body of the template, you can insert the syntax in a form field. If you want the brought forward total to display in the header, you must insert the full code string into the header because Microsoft Word does not support form fields in the header or footer regions.
BI Publisher will recognize any content above the defined body area as header content, and any content below as the footer. This allows you to use form fields. See Multiple or Complex Headers and Footers for details. Place the carried forward object at the bottom of your template where you want the total to display.
The carried forward object for our example is as follows:. The display-condition is set to exceptlast so that the carried forward total will display on every page except the last page. The show-carry-forward element is used to show the carried forward value. It has the same properties as brought-carried-forward, described above. The variable functionality see Using Variables can be used to add a running total to your invoice listing report.
This example assumes the following XML structure:. Using this XML, we want to create the report that contains running totals as shown in the following figure:. To create the Running Total field, define a variable to track the total and initialize it to 0. The template is shown in the following figure:. You can sort a group by any element within the group.
Insert the following syntax within the group tags:. To sort a group by multiple fields, just insert the sort syntax after the primary sort field. To sort by Supplier and then by Invoice Number, enter the following. In your report layout, you may want to specify a different behavior depending on the presence of the element and its value.
The following examples show how to check for each of these conditions using an "if" statement. The syntax can also be used in other conditional formatting constructs. With this feature, your template does not have to follow the hierarchy of the source XML file. You are therefore no longer limited by the structure of your data source. To demonstrate the for-each-group standard, the following XML data sample of a CD catalog listing will be regrouped in a template:.
Using the regrouping syntax, you can create a report of this data that groups the CDs by country and then by year.
You are not limited by the data structure presented. You can then refer to the elements of the group to display the values desired. At runtime, BI Publisher will loop through the occurrences of the new groupings, displaying the fields that you defined in your template. Note: This syntax is a simplification of the XSL for-each-group syntax.
If you choose not to use the simplified syntax above, you can use the XSL syntax as shown below. The XSL syntax can only be used within a form field of the template. The following figure shows a template that displays the CDs by Country, then Year, and lists the details for each CD:. The following table shows the BI Publisher syntax entries made in the form fields of the preceding template:.
Regrouping by an expression allows you to apply a function or command to a data element, and then group the data by the returned result. To demonstrate this feature, an XML data sample that simply contains average temperatures per month will be used as input to a template that calculates the number of months having an average temperature within a certain range. You want to display this data in a format showing temperature ranges and a count of the months that have an average temperature to satisfy those ranges, as follows:.
You can then display a count of the members of each grouping, which will be the number of months having an average temperature that falls within each range. The floor function is an XSL function that returns the highest integer that is not greater than the argument for example, 1.
This will generate the following values from the XML data: 1, 1, 1, 2, 3, 3, 3, 3, 2, 2, 1, and 0. These are sorted, so that when processed, the following four groups will be created: 0, 1, 2, and 3. The expression concatenates the value of the current group times 10 with the value of the current group times 10 plus This allows you to create many new features in your templates that require updateable variables. In a multi-threaded environment there may be many transformations occurring at the same time, therefore the variable must be assigned to a single transformation.
See the section on Running Totals for an example of the usage of updateable variables. You can pass runtime parameter values into your template. These can then be referenced throughout the template to support many functions.
For example, you can filter data in the template, use a value in a conditional formatting block, or pass property values such as security settings into the final document. You must register the parameters that you wish to utilize in your template using the syntax described below. The syntax must be declared in the Help Text field of a form field. The form field can be placed anywhere in the template. This example illustrates how to declare a parameter in your template that will filter your data based on the value of the parameter.
The following figure displays a template that accepts a parameter value to limit the invoices displayed in the final document based on the parameter value. If we pass in a parameter value of 1,, the following output shown in the following figure will result:. The properties set in the template are resolved at runtime by the BI Publisher engine. You can either hard code the values in the template or embed the values in the incoming XML data. Embedding the properties in the template avoids the use of the configuration file.
For example, if you use a nonstandard font in your template, rather than specify the font location in the configuration file, you can embed the font property inside the template. To add an BI Publisher property to a template, use the Microsoft Word Propertie s dialog available from the Fil e menu , and enter the following information:. Value - enter the property value. This font is not available as a regular font on your server, therefore you must tell BI Publisher where to find the font at runtime.
You tell BI Publisher where to find the font by setting the "font" property. Note that if the template is deployed in multiple locations, you must ensure that the path is valid for each location. For more information about setting font properties, see Font Definitions. The XML data is as follows:. In the Properties dialog set two properties: pdf-security to set the security feature as enabled or not, and pdf-open-password to set the password.
Enter the following in the Properties dialog:. To avoid this potential security risk, you can use a template parameter value that is generated and passed into the template at runtime. For more information about template parameters, see Defining Parameters in Your Template. It is a common requirement to print a batch of documents, such as invoices or purchase orders in a single PDF file. Because these documents are intended for different customers, each document will require that the page numbering be reset and that page totals are specific to the document.
If the header and footer display fields from the data such as customer name these will have to be reset as well. BI Publisher supports this requirement through the use of a context command. This command allows you to define elements of your report to a specific section. When the section changes, these elements are reset. The following example demonstrates how to reset the header and footer and page numbering within an output file:.
The following figure shows a sample template. The page numbers will restart, and if header or footer information is derived from the data, it will be reset as well.
The columns of a cross-tab report are data dependent. At design-time you do not know how many columns will be reported, or what the appropriate column headings will be. Moreover, if the columns should break onto a second page, you need to be able to define the row label columns to repeat onto subsequent pages. The following example shows how to design a simple cross-tab report that supports these features.
From this XML we will generate a report that shows each industry and totals the sales by year as shown in the following figure:. The template to generate this report is shown in the following figure. The form field entries are shown in the subsequent table. Note that only the first row uses the column context to determine the number of columns for the table.
All remaining rows need to use the cell context to create the table cells for the column. For more information about context commands, see Using the Context Commands. The ability to construct dynamic data columns is a very powerful feature of the RTF template.
Using this feature you can design a template that will correctly render a table when the number of columns required by the data is variable. For example, you are designing a template to display columns of test scores within specific ranges. However, you do not how many ranges will have data to report. You can define a dynamic data column to split into the correct number of columns at runtime.
Use the following tags to accommodate the dynamic formatting required to render the data correctly:. Use one of these tags to define the width of the column when the width is described in the XML data. The width can be described in two ways:.
An XML element stores the value of the width. Use this tag to define a multiplier for the column width. If the multiplier is not defined, the widths of the columns are calculated as a percentage of the total width of the table. This is illustrated in the following table:. If your table columns expand horizontally across more than one page, you can define how many row heading columns you want to repeat on every page.
0コメント