Your search did not match any results.
We suggest you try the following to help find what you’re looking for:
Based on Oracle Application Express (formerly called HTML DB) version 1.5
After completing this How-To, you should be able to understand:
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:
Figure 2 - Tasks
declare q varchar2(4000); begin q:=' select p.category, '; q:=q||' p.product_name, '; q:=q||' i.quantity, '; q:=q||' i.unit_price '; q:=q||' from demo_product_info p, '; q:=q||' demo_order_items i '; q:=q||' where p.product_id = i.product_id '; if :p600_show != 'ALL' then q:=q||'and p.category = :p600_show'; end if; return q; end;
The PL/SQL function returning a SQL Query we are using above uses an page item. Follow these steps to create the page item:
select distinct category a, category b from demo_product_info order by 1
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.