Master/Detail Reports in HTML

The last HTML reporting challenge that I want to talk about is that of generating master/detail reports such as the Project Hours and Dollars Detail report generated by Example 5-8. For these reports, you cannot avoid the use of TTITLE. You do want to define a header that repeats throughout the report because you need a way to indicate when the master record changes.

Example 6-8 recreates the Project Hours and Dollars Detail report in HTML form. Figure 6-5 shows the result, and as you probably expect by now, Example 6-9 shows the CSS stylesheet used to produce the layout that you see in the figure. Pay particular attention to the following aspects of this report example:

  • The page heading, the one that occurs once at the top of the HTML page, is written to the HTML stream using PROMPT commands, just as in Example 6-6. PROMPT commands also write the <div> tags.

  • TTITLE is used to specify the line that prints for each new master record. This line is written out as a level-3 heading using the <h3> tag. (Unfortunately, it's written into the leftmost cell of a three-column table.)

  • Similar to what was done in the previous section, the <div> containing the page title is formatted as white text on black, while the <div> containing the report detail is formatted as black text on light gray.

  • To distinguish the detail lines from the master lines, the detail table has been indented a bit and it has been given a white background. See the table.detail style in Example ...

Get Oracle SQL*Plus: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.