 |
|
Oracle Tips by Burleson |
Formatting Numeric and Date Columns
Text displayed in a web page has no data type; it
is all just text. HTML DB provides a mechanism for developers to
convert data types, such as numbers and dates, into a format
consistent with the data being displayed. Displaying dates in the
default Oracle format is not generally how users expect to see their
dates. Also, a dollar amount is much prettier if it is formatted
accordingly. The next two exercises are meant to show how easy it is
to render this type of data in a more natural format.
The following exercises continue to work with page
11 in the Conference RSVP application.
Formatting a Numeric column
1.
Navigate to page 11 in the Conference RSVP application.
2.
Click on the Report link next to the Conference – Confirmed
Attendees report region.
3.
Click on the edit link for the DONATION column.
4.
For the Number / Date Format attribute click on the icon.
5.
When the popup is displayed, click on one of the currency style
formats.
6.
Click the Apply Changes button to return to the Report
Attributes page.
7.
On the Report Attributes page, change the Column Alignment for
the DONATION column to right.
8.
Click the Apply Changes button to finish.
9.
Run the report to see the changes.
Formatting a Date column
1.
Navigate to page 11 in the Conference RSVP application.
2.
Click on the Report link next to the Conference – Confirmed
Attendees report region.
3.
Click on the edit link for the RSVP_DATE column.
4.
For the Number/Date Format attribute click on the icon.
5.
When the popup is displayed, click on one of the date formats.
If none of the formats are acceptable and
the developer knows how to type in a preferable date format, that can
be done instead.
6.
Click the Apply Changes button to finish.
7.
Run the report to see the changes.
 |
For more details and scripts, see my new book "
Oracle
Tuning: The Definitive Reference", over 900 pages
of BC's favorite tuning tips & scripts.
You can buy it direct from the publisher for 30%-off and get
instant access to the code depot. |
|