Oracle9i OLAP Services Developer's Guide to the OLAP DML
Release 1 (9.0.1)

Part Number A86720-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Writing Reports, 2 of 12


Introducing the Reporting Commands

Creating simple reports

Sometime you only need to quickly report the output for one or more data expressions. To produce a simple report you can use the REPORT command. This command automatically loops over the dimensions of the data and formats the output in a default layout. Output from the REPORT command is sent to the current outfile.

You can also customize the layout REPORT produces by using a number of options. In fact, because REPORT has an underlying format similar to ROW, all the options available with the ROW command (discussed later) are available with REPORT.

Sample simple report

You can create a simple report of the values of the STATE.CITY relation with the following command:

REPORT STATE.CITY

This command creates the following simple report

CITY           STATE.CITY
-------------- ---------------
ATLANTA        GEORGIA
CHICAGO        ILLINOIS
SPRINGFIELD    ILLINOIS

Creating complex reports

The OLAP DML includes a number of commands, functions, and options that you can use to write complex reports. The following table summarizes the commands, functions, and options that you can use to write reports.

Elements 

Description 

Commands 

Produce rows of data and text. There are three key commands:

  • ROW -- Produces rows of data

  • HEADING -- Produces rows for titles, column headings, and side headings

  • BLANK -- Produces blank rows

Attributes in ROW and HEADING commands provide custom formatting for data and text output. 

Format options 

Control the default format of report output. The key format options include COLWIDTH, DECIMALS, LCOLWIDTH, and PARENS. 

Calculation functions 

Perform calculations on numeric data in a report. There are three key calculation functions:

  • COLVAL -- Performs calculations on data in a row

  • SUBTOTAL -- Calculates subtotals and totals for data columns

  • RUNTOTAL -- Calculates running totals for data columns

 

Paging options 

Provide paginated report output, and control features such as page size, margin size, and standard page headers. To produce paginated output, the PAGING option must be set to YES. 

By combining these elements in a program, you can create custom reports with special formatting. For example, you can create a report with a different variable in each column or with a different variable in each row. You can format the data on each row exactly as you want, showing a different number of decimal places and appending different text (such as a dollar sign or percent sign) to each item in a row.

You can use special report calculation functions to perform calculations on the data in the rows and columns of a report.

To create a customized report, you combine the reporting commands, functions, and options with other OLAP DML commands in a program. Although you will use combinations of various commands in programs, you can experiment with most of the commands individually.


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback