 |
|
Oracle Tips by Burleson |
Adding
the Number of Rows Item to a Report
This feature allows the user to control pagination
of the report by selecting how many rows will be displayed on each
page. This feature is used often on various pages in HTML DB. Figure
7.6 shows this feature being used on the Application home page.
Providing user selectable pagination is a two step
process.
Since select list components are covered in
greater detail in the chapter on Creating Other HTML DB Components,
only brief step-by-step instructions will be given here.
Create the Number of
Rows Select List
This is an item that is not present on the
original Report page of the Conference RSVP application. However, it
is a common feature to provide on reports. It is created as follows:
1.
While running the page, click on the Edit Page 11 link in the
developer toolbar.
2.
Click on the icon
in the Items section.
3.
Choose the Select List option and click Next.
4.
For Select List Control Type, leave the default: Select List –
and click Next.
5.
On the Display Position and Name page:
-
Item Name: P11_ROWS
-
Sequence: 15
The sequence
will be set to 15 because this Select List is to be displayed between
the Search page item and the Go button. The Search page item has a
sequence of 10, and the Go button has a sequence of 20. Setting the
p11_rows select list to a sequence of 15 will cause the HTML DB engine
to put it between the other page components.
6.
On the List of Values page
-
Display Null Option: NO
-
List of Values Query:
STATIC2:5;5,10;10,15;15,25;25,50;50,100;100
What this does
is create a static list of values to display in the select list.
After entering the static text, click on the link Create or edit
static List of Values to view a popup that will guide you through the
creation. If the developer is the kind of person who finds it
difficult to remember the proper syntax to use when creating the
static list, using the link will help.
7.
On the Item Attributes page:
8.
Leave all the other values with the default values and click
Next.
9.
On the next page click the Create Item button.
Once back on the
Page Definition page, it will be necessary to make a couple change to
the P11_ROWS select list.
10.
Click on the P11_ROWS Select List link.
11.
On the Edit Page Item page:
The reason behind this setting is covered later in this book in the
section called Controlling Form Layout.
Modify the Report to
use the Number of Rows Select List
1.
From the Page Definition page, click on the Report link as shown in
Figure 7.2.
It is likely that everyone will eventually forget what the name of
the item is they want to put in the Number of Rows (Item) page
item. If this happens, the Flashlight icon can
be used to display a popup window of available page item names.
2.
In the Layout and Pagination region, enter the text P11_ROWS,
which is the Select List item created earlier, in Number of Rows
(Item). Then click Apply Changes.
3.
Run the page with the new modifications.
4.
Clear the text in the Search page item and click the Go button.
5.
Change the value in the Display select list to 25 and click the Go
button.
What was accomplished in this section was learning
how to add a page component that enables a user to customize the way
they see the data in a report. However, it was still necessary to
manually delete the data from the Search page item. The next logical
step is to provide a button for the user that enables them to Reset
the page.
The above book excerpt is from:
Easy HTML-DB
Oracle Application Express
Create Dynamic
Web Pages with OAE
ISBN 0-9761573-1-4
Michael Cunningham & Kent
Crotty
http://www.rampant-books.com/book_2005_2_html_db.htm |