16.13 Printing a Report Region by Defining a Report Query

Print a report region by defining a report query.

16.13.1 About Report Queries

Learn about report queries.

You can print a report region by defining a report query as a Shared Component. A report query identifies the data to be extracted. Unlike SQL statements contained in regions, report queries contain SQL statements that are validated when you save the query. Note that report queries must be SQL statements, not functions returning SQL statements.

You can associate a report query with a report layout and download it as a formatted document. If no report layout is selected, a generic layout is used. The generic layout is intended to be used to test and verify a report query. When using the generic layout option and multiple source queries are defined, only the first result set is included in the print document. The reports can include session state of the current application.

To make these reports available to end users, you then integrate them with an application. For example, you can associate a report query with a button, list item, branch, or other navigational component that enables you to use URLs as targets. Selecting that item then initiates the printing process.

16.13.2 Creating a Report Query

Create a report query in Shared Components.

Note that the availability of the report query options depends on how your service administrator configures report printing for your instance. All options described in these steps may not be available to you.

To create a report query:

  1. Navigate to the Shared Components page:
    1. On the Workspace home page, click App Builder.
    2. Select an application.
    3. On the Application home page, click Shared Components.

      The Shared Components page appears.

  2. Under Files and Reports, click Report Queries.
  3. Click Create.
  4. Report Query Definition - Specify the following:
    1. Report Query Name - Enter a name to identify the report query. When referencing a report query as a link target, the report query name is part of the request string.
    2. Output Format - Select the report output format. Valid options include:
      • PDF - Adobe Portable Document Format.

      • Word - Microsoft Word Rich Text Format.

      • Excel - Microsoft Excel format. Note that this is not a true .xls file because the content is HTML-based.

      • HTML

      • XML - Extensible Markup Language.

    3. Item - Select the item to hold the format value. You can use this item to determine the output format at runtime.
    4. View File As - Select how the web browser opens the report query document. Options include:
      • Attachment - Displays a File Open/Save dialog box when the user clicks the report query download button.

      • Inline - Displays the report query document inside the Browser window.

    5. Session State - Select this checkbox to reference session state values, such as the values of page items in the XML structure of your report.
    6. Click Next.
  5. Source Queries - For SQL Query, .
    1. SQL Query - Enter a SQL statement to define the report query.
    2. Set Bind Variables - Click Set Bind Variables to be able to enter in values for each bind variable and test the query to ensure the expected output is returned.
    3. Click Next.
  6. Download Definition:
    1. Data Source for Report Layout - Use this option to download a report definition export file.

      Tip:

      The report query definition is what a developer would use as the source for tools like BI Publisher Desktop or Altova Stylevision to create the report layout. Some tools accept both an XML export of the data as well as an XML scheme definitions as source, other tools may only accept one or the other. If the source query does not return data at design time, then XML schema provides a way to export the definition without data.

      Select XML Data or XML Schema and click Download.

      XML Schema creates XSD file (that is, a XML schema definition of your XML structure.)

    2. Add Query - Click this button to add another query to the report query. Adding another query enables the production of complex reports with more than one output component (for example, a chart and a report based on two different queries).
    3. Create Report Query - Click this button to exit the wizard early. The Report Layout Source defaults to use the generic report layout.
    4. Click Next.
  7. Upload Report Layout:
    1. Report Layout Source - Specify whether to use the generic built-in report layout or a custom report layout.
    2. Layout Name - Enter a layout name (optional). The default is the report query name.
    3. Report Layout File - Select the file to upload.
    4. Click Next.
  8. Confirm displays the following information:
    1. Query Name - Identifies the query.
    2. Report Layout - Identifies the report layout you selected.
    3. Output Format - Identifies the format for this report query.
    4. Derive from Item - Identifies the item to hold the format information.
    5. URL - Report queries can be integrated with an application by using the URL shown as the target for buttons, navigation list entries, list items, or any other type of link. Click into the URL field to copy & paste the URL.
    6. Test Report - Click this to preview your report. If you have chosen to use a generic report layout then the Test Report does not produce an output.
    7. Click Create.

      The Report Query is created and saved to Shared Components.

16.13.3 Editing a Report Query

Edit a report query in Shared Components.

To edit a report query:

  1. Navigate to the Shared Components page:
    1. On the Workspace home page, click App Builder.
    2. Select an application.
    3. On the Application home page, click Shared Components.

      The Shared Components page appears.

  2. Under Files and Reports, click Report Queries.
  3. Select the appropriate report query.
  4. On the Edit page, edit the appropriate attributes.
  5. Click Apply Changes.

16.13.4 Copying a Report Query

Copy a report query in Shared Components.

To copy a report query:

  1. Navigate to the Shared Components page:
    1. On the Workspace home page, click App Builder.
    2. Select an application.
    3. On the Application home page, click Shared Components.

      The Shared Components page appears.

  2. Under Files and 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 name for the report query, and click Copy.

    The copy appears in the query list.