| How-To Document
Build a Report Based on a Dynamic Query
After completing this How-To, you should be able to understand:
Table of Content
In HTML DB a report is simply the formatted result of a SQL query. You can generate reports by:
Certain applications require that report results are based on user input (see Figure 1). Typically, this requires a dynamic query which incorprates session state values. In this How To, we will create a report based on a PL/SQL function which generates a SQL Query at runtime.
Figure 1 - Ordered Products
We will extend Sample Application that is included when a new workspace is provisioned. To create a dynamic query report, follow these steps:
The PL/SQL function returning a SQL Query we are using above uses an page item. Follow these steps to create the page item:
For the report to be driven by the product category select list, we need to submit the page. To make this happen, we will add a button as follows:
Now you can run the page, choosing different product categories to control the output of ths report. If you wish to enhance the look of the report, read the Customizing HTML DB Reports How To.
Discuss this how-to in the OTN HTML DB Forum.