In this section: |
The only requirement for reporting is identifying a data source. Beyond that, the structure of a report request is very flexible and you only need to include the report elements you want. For example, you only need to include sorting instructions if you want your report to be sorted, or selection criteria if you want to report on a subset of your data.
A report request begins with the TABLE FILE command and ends with the END command. The commands and phrases between the beginning and end of a request define the contents and format of a report. These parts of the request are optional; you only need to include the commands and phrases that produce the report functions you want.
The following are the most frequently used options for structuring a report request.
You can sort information vertically, down a column, or horizontally, across a row. You can also combine vertical sorting and horizontal sorting to create a simple matrix.
For details see, Creating Temporary Fields.
For details, see Joining Data Sources.
For details, see Saving and Reusing Your Report Output.
You can run the request as an ad hoc query or save it as a procedure. Saving a report request as a procedure enables you to run or edit it at any time.
How to: |
A report request begins with the designation of a data source. You can then specify the details of your report request. A data source can be specified in the following ways:
For details on the FILE SET parameter, see the TIBCO WebFOCUS® Developing Reporting Applications manual.
To begin a report request, use the command
TABLE FILE filename
where:
Is the data source for the report.
To complete a report request, use the END or RUN command. These commands must be typed on a line by themselves. To discontinue a report request without executing it, enter the QUIT command.
If you plan to issue consecutive report requests against the same data source during one session, you have the option of using the RUN command. RUN keeps the TABLE facility and the data source active for the duration of the TABLE session. After viewing one report you do not need to repeat the TABLE command to produce another report. You terminate the TABLE session by issuing the END command after the last request.
The example in this topic is a simple report request that illustrates some of the basic functions of WebFOCUS. However, there are many more functions not shown here that you can find information on throughout this documentation.
The following annotated example illustrates some of the basic functions of WebFOCUS. The numbered explanation in this example corresponds with the code in this request. This request can be generated by typing the commands into a text editor.
1. JOIN PIN IN EMPDATA TO ALL PIN IN TRAINING AS J1 2. DEFINE FILE EMPDATA YEAR/YY=COURSESTART; 3. END 4. TABLE FILE EMPDATA 5. HEADING CENTER "Education Cost vs. Salary" 6. SUM EXPENSES AS 'Education,Cost' SALARY AS 'Current,Salary' 7. AND COMPUTE PERCENT/D8.2=EXPENSES/SALARY * 100; AS 'Percent' 8. BY DIV BY DEPT 9. WHERE YEAR EQ 1991 10. ON TABLE SUMMARIZE 11. ON TABLE SET STYLE * TYPE=HEADING, STYLE=BOLD, COLOR=BLUE,$ TYPE=REPORT, FONT=TIMES, SIZE=8,$ TYPE=REPORT, GRID=OFF,$ ENDSTYLE 12. END
The output is:
The request processes in the following way: