A report script is a text string that contains the data extraction and data formatting commands required to generate output from the Essbase Server. See the Oracle Essbase Technical Reference for a full description of the Report Writer language. The following principal elements generally need to be included in a report script for an API application:
{TABDELIMIT} command—Include at the beginning of any report script sent to the API. It causes the output data to be returned in a format useful for parsing within a program. This command suppresses all unnecessary formatting (for example the commas used as thousand separators in numbers) and returns each member name or data value as a tab-separated token, that can be parsed and divided into cells.
{DECIMALS n} command—Specifies the decimal precision of the returned numeric data (all numbers are stored internally as floating point numbers with 15 digits of precision). For example, {DECIMALS 2} gives two digits of decimal precision.
{INDENTGEN n} command—Allows a program the option of indenting either parent members or child members in the rows of the report output. A negative value of n indents parent members by n spaces relative to their children. A positive value of n indents the child members by n spaces relative to their parents. A zero value of n turns off all indenting. For example, {INDENTGEN -2} indents parent members by two spaces per level (the default):
100-10 47 41 50 138 100-20 44 38 49 131 100-30 21 14 20 55 100 112 93 119 324 200-10 25 19 23 67 200-20 18 14 18 50 200-30 17 9 14 40 200 60 42 55 157 Product 287 217 290 794
{SUPMISSING} and {SUPZERO} commands—Eliminates unnecessary rows in the report output. The {SUPMISSING} command suppresses the output of all data rows that contain only #Missing values (that is, no actual data), and the {SUPZERO} command suppresses the output of rows that contain only zero values.
Also useful are the {SUPBLANK} command, that suppresses both zero and #Missing values, and the {SUPALL} command, that suppresses a range of report output parameters.
{MISSINGTEXT string} command—Converts #Missing values in the output data to a string specified by the program. For example {MISSINGTEXT "N/A"} converts any #Missing values to the string "N/A".
{OUTALTNAMES} or {OUTMBRNAMES} commands—{OUTALTNAMES}enables you to use alias names instead of member names in the output. To revert to member names, use {OUTMBRNAMES} (the default).
<PAGE, <COL and <ROW commands—Specify how the different dimensions are oriented in a report. <PAGE specifies which dimensions are in the page header (at the top of the report), and <COL and <ROW specify that dimensions are in the columns and rows, respectively. For example, <ROW(Market, Product) forces the members of the Market and Product dimensions to be displayed in that order in the rows of the report.
Any member from any dimension can be specified in <PAGE, <COL, and <ROW. Each dimension should appear in only one of these commands, otherwise the last command takes precedence, and all dimensions should be specified (or the report layout will be unpredictable).
List of member names (including any macro commands)—To extract the data required in the report by the simplest method, list the members concerned. For example, "Actual Sales Ohio Jan Feb Mar Product" produces the following report output:
Actual Sales Ohio Jan Feb Mar Product 287 217 290
Alternately, you can use macro commands to specify a range of members from a dimension. Consider the following example:
<CHILDREN / <ICHILDREN
<DESCENDANTS / <IDESCENDANTS
<DIMBOTTOM
<ALLINSAMEDIMENSION
<ONSAMELEVELAS
<PARENT
<ANCESTORS
Note: | All the above macro commands can be abbreviated, for example, <DESC, <ICHILD, and <PAR. |
The most commonly used of the above macro commands are <CHILD (or <ICHILD) to perform a single level drill-down; <DESC (or <IDESC) to perform multilevel drill-downs, and <DIMBOTTOM to drill down to the lowest level members of a dimension.
For example, "Actual Sales Ohio <ICHILD Qtr1 <DESC Product" produces the following report output:
Actual Sales Ohio Jan Feb Mar Qtr1 100-10 47 41 50 138 100-20 44 38 49 131 100-30 21 14 20 55 100 112 93 119 324 200-10 25 19 23 67 200-20 18 14 18 50 200-30 17 9 14 40 200 60 42 55 157 300-10 30 19 32 81 300-20 24 16 25 65 300-30 12 7 11 30 300 66 42 68 176 400-10 30 27 32 89 400-20 14 10 12 36 400-30 5 3 4 12 400 49 40 48 137 100-20 44 38 49 131 200-20 18 14 18 50 300-30 12 7 11 30 Diet 74 59 78 211
Because member names can be numbers (for example, "100") and can contain embedded spaces (for example, "New York"), it is always a good practice to surround member names with double quotation marks when sending a report script to the API. In Release 4.0 and above, you can force member names to be output in this format by using the {QUOTEMBRNAMES} command.
Bang (!)—The final element of a report script must always be a bang (!), the exclamation point character. Each script must have one (at least one) bang to cause data to be generated. If a report script appears to be executing correctly but no data is output, check to make sure that you are appending a bang to the report script.
Many of these elements are typical user-configurable parameters that are set up in advance by the user, either globally or per-report (or both).
See API Libraries.