Configuring Printing for Reports

Previous
Previous
 
Next
Next

You can set up an application so that end users can print reports in these ways:

Both report regions and report queries can be downloaded in the following formats:

For more information about the report printing functionality, go to:

http://www.oracle.com/technology/products/database/application_express/index.html

Topics:


See Also:

To use the full functionality of report printing, your Oracle Application Express service administrator must enable it for your site. See "Configuring Report Printing".

About Report Layouts

To format either a report region or report query, you associate it with a report layout. Using report layouts renders the data in a printer-friendly format. If you do not select a report layout, a default XSL-FO layout is used.

Application Express provides a lot of flexibility when creating and using report layouts:

Creating Report Queries

Note that the availability of the Report Query options depends on how your service administrator configured the report printing settings at your site. All options described in these steps may not be available to you.

To create a report query:

  1. Navigate to the Shared Components page. See "Accessing the Shared Components Page".

  2. Under Reports, click Report Queries.

  3. Click Create.

  4. For Query, specify the following information:

    1. Name - Enter a name for your report query.

      This name will be part of the request string in the URL used to download the report query.

    2. SQL Query - Enter a SQL statement directly or click Query Builder to build a SQL statement by clicking and pointing.

      To reference applications and page items in the SQL statement, reference them as bind variables.

    3. Click Next.

  5. To test the query, click Test Query. Testing the report query ensures that the desired result set is returned.

    If you include bind variables, you are able to set test values before running the query. The test values are then used in subsequent steps in this wizard, when exporting the XML structure of your report query and to download a formatted test version of your report query.

  6. After you test the query, click Next.

  7. (Optional) For Include Session State, specify the following:

    1. To include a session state, click the up arrow and select an item from the list.

      Use a session state item to show additional data along with your report. For example, select an item to display a customer address to display that information on an order form. The order header information is shown along with order details.

    2. Click Add to move the item to the box.

    3. Click Next.

  8. For Download XML, follow the on-screen instructions.

  9. For Confirm:

    1. Query Name - Identifies the query.

    2. Report Layout - Identifies the report layout you selected.

    3. Output Format - Select the format for this report query.

    4. (Optional) Item - Select the item to hold the format information.

    5. URL - To integrate this report with your application, use the displayed URL as the target for a button, list item, link, or other navigational component. This enables end users to click a button, for example, to start the printing process.

    6. Test Report - Click this to preview your report.

    7. Click Finish.

      The Report Query is created and saved to Shared Components.

Editing Report Queries

To edit a report query:

  1. Navigate to the Shared Components page. See "Accessing the Shared Components Page".

  2. Under Reports, click Report Queries.

  3. On the Report Queries page, you can use the Navigation bar at the top of the page to search for a query by name or change the page display. For example, you can change the default display by making a selection from View list. Available options include:

    • Icons (the default) displays each query as a large icon. To edit a query, click the appropriate icon.

    • Details displays each query as a line in a report. To edit a query, click the name.

  4. Edit the information.

  5. To export the report as XML, click the link in the Tasks list.

  6. Click Apply Changes.

Copying Report Queries

To copy a report query:

  1. Navigate to the Shared Components page. See "Accessing the Shared Components Page".

  2. Under Reports, click Report Queries.

  3. On the Report Queries page, click Copy.

  4. On the Copy Report Query, select the query you want to copy, enter a new name for the copy, and click Copy.

    The new copy appears in the query list.

Creating Report Layouts

Create report layouts to associate with a report query or report region. You can create a new report layout based on one of these options:

Note that the availability of the Report Layout options depends on how your service administrator configured the report printing settings at your site. All options described in these steps may not be available to you.

To create a report layout:

  1. Navigate to the Shared Components page. See "Accessing the Shared Components Page".

  2. Under Reports, click Report Layouts.

  3. Click Create.

    The Create Report Layout wizard appears.

  4. For Layout Type, select an option and click Next:

    • Generic Columns (XSL-FO) - This layout is pre-populated with a default template, which you can edit to fit your needs.

    • Named Columns (RTF) - This layout is uploaded as an RTF file.

    • Named Columns (XSL-FO) - This layout is uploaded as an XSL-FO file.

  5. For Layout Source, review and edit the appropriate information. The options that appear on this page depend on the layout type you select:

    • If you selected Generic Columns:

    1. Report Layout Name - Enter a name to identify the report layout when associating it with a report query or report region.

    2. Report Layout - The report layout is the XSL-FO based definition of the page formatting. All attributes defining page size, orientation, fonts, styles, and so on, are defined in this section.

      To see a list of valid substitution strings and other information, click the item label, Report Layout. This opens a separate Help window.

    3. Report Column Heading - Defines the look of each cell in the report heading row.

    4. Report Column - Defines the look of each cell for all report rows.

    5. Report Column Width - This width is computed at runtime time or can be derived from the report column definition of a report region.

    • If you selected Named Columns:

    1. Report Layout Name - Enter a name to identify the report layout when associating it with a report query or report region.

    2. Upload the file containing the report layout.

Editing Report Layouts

You can edit a generic column report layout directly in Application Express. However, to edit a named column report layout, you need to download the current file, edit it, and then upload it again.

To edit a report layout:

  1. Navigate to the Shared Components page. See "Accessing the Shared Components Page".

  2. Under Reports, click Report Layouts.

  3. On the Report Layouts page, select the layout you want to edit.

  4. For generic column layouts, edit the layout directly on the Edit Report Layout. Then click Apply Changes.

  5. For named column layouts, click Download and save the file to your computer.

    Edit the file and then upload the updated version as a new report layout.

Copying Report Layouts

You can copy a report layout to edit and save.

To copy a report layout:

  1. Navigate to the Shared Components page. See "Accessing the Shared Components Page".

  2. Under Reports, click Report Layouts.

  3. On the Report Layouts page, click Copy.

  4. On the Copy Report Layout page, select the layout you want to copy, enter a new name for the copy, and click Copy.

    The new copy appears in the layout list.

Overview of Printing Report Regions

To download or print report regions in the supported formats, you need to follow these general steps:

  1. Select the page containing the report region you want to set up.

  2. Create or select a region of type Report.

    A report query, based on a standard SQL query whose results appear in your report, must be associated with this region.

  3. Enable report printing for that region.

    You must select this option. For the remaining steps in this task, you can accept the defaults or select different options.

  4. Select an output format.

  5. Associate a report layout with the report region.

    The default report layout includes a Print link that appears under the report. You can replace that with your own custom button.

  6. Set up other printing attributes, such as the paper size, orientation, header and footer.

    If you use the default report layout, the end users click the Print link to initiate the print process.

Configuring Print Attributes for Report Regions

If the printing feature is set up for your site, you can configure a report region to print in various formats.

To configure a report region for printing:

  1. In your application, select the page containing the report region you want to print.

    The Page Definition appears.

  2. Under Regions, click Report next to the region you want to print.

  3. Click the Print Attributes tab.

  4. Under Printing, specify the appropriate information:

    • Enable Report Printing - Select Yes.

    • Link Label - Enter the text for the link that starts the printing process.

    • (Optional) File Name - Enter a name for the downloaded file. If you leave this blank, the region name is used as the file name.

    • Output Format - Select an output option.

    • Item - If you select Derive from Page Item, select the item.

    • Report Layout - Select Default Report Layout or an available report layout you or your administrator created.

  5. In the remaining sections, define page size, paper orientation, page headers and footers, fonts, text color, and background color.

  6. Click Apply Changes.

If you used the default template, end users can click a Print link to print the report in the format you specified for this region.