In this section: |
In WebFOCUS App Studio a report is a WebFOCUS procedure (with a .fex extension) that returns data from a selected data source, and displays it in a column/row format. You create an WebFOCUS App Studio report using the Report Wizard. The wizard lets you specify the location where the report is saved and the data source. It then opens the Report canvas. The Report canvas includes the Object Inspector pane that contains the measures and dimensions of the selected data source. You can drag and drop objects from the Object Inspector to populate the columns and rows of your report.
When you make selections in the Report Wizard, WebFOCUS syntax is automatically generated to produce the report output. You can create reports easily, with no knowledge of the syntax. However, for a summary of WebFOCUS reporting syntax, see Reporting Syntax Summary.
How to: |
The following image shows a tabular report, which displays cost of goods and revenue sorted across brand types and by product category, creating a matrix report. When you include both BY and ACROSS sort phrases in a report request, information is sorted vertically and horizontally, turning the report into a matrix of information that you read like a grid. A matrix report can have multiple BY and ACROSS sort fields.
Note: The default StyleSheet is used to format the report. You can create your own StyleSheet or choose from other StyleSheets that are available in the product.
The Report Wizard opens.
The Report canvas opens.
The Set canvas opens.
The NODATA setting now appears in the Used Settings area.
You can create the tabular report using the following WebFOCUS syntax, which you can type into a procedure using the Text Editor.
TABLE FILE WF_RETAIL HEADING "Cost and Revenue" SUM COGS_US REVENUE_US BY PRODUCT_CATEGORY ACROSS BRANDTYPE ON TABLE SET NODATA N/A END
How to: |
The following image shows an Analytic Document designed for offline analysis. The request uses the ON TABLE PCHOLD FORMAT AHTML command to create the HTML Analytic Document. Analysis options include filtering, sorting, charting, and much more. You click an arrow next to a column heading to gain access to the analytic options. For more information on In-Document Analytics, see the TIBCO WebFOCUS® Active Technologies User's Guide.
You can create the using the following WebFOCUS syntax, which you can type into a procedure using the Text Editor.
TABLE FILE WF_RETAIL HEADING CENTER "Cost and Revenue" SUM COGS_US REVENUE_US BY PRODUCT_CATEGORY ACROSS BRANDTYPE ON TABLE PCHOLD FORMAT AHTML ON TABLE SET NODATA N/A END
You can select the sort order of display for a control for In-Document Analytic formats in the HTML and Document canvas. You can select Ascending or Descending from the Sort order option in the Settings panel. Ascending is the default value selected. At run time, the values will be sorted based on the sort order selected.
When you run the report, as shown in the following image, notice that date values are sorted in ascending order. Ascending is the default value.
When you run the report, as shown in the following image, notice that the date values for the control are now sorted in the descending order.
How to: |
The following image shows an Excel Workbook with multiple worksheets (tabs) for each value of the major sort field (BY) and with formulas for the column totals. The request uses the ON TABLE PCHOLD FORMAT XLSX FORMULA BYTOC command to create the multiple worksheets.
The Output Format Options dialog box opens.
You can create the Excel Formula Table of Contents report using the following WebFOCUS syntax, which you can type into a procedure using the Text Editor.
TABLE FILE WF_RETAIL HEADING "Cost and Revenue" SUM COGS_US REVENUE_US BY BRANDTYPE BY PRODUCT_CATEGORY ON TABLE SUBTOTAL ON TABLE PCHOLD FORMAT XLSX FORMULA BYTOC END
How to: |
In a financial report, specific rows can be placed anywhere in the report.
The following image shows a financial report with cost and revenue for specific products.
The Report Wizard opens.
The Report canvas opens.
On the Report tab, in the Style group, click Change Theme. In the Open File dialog box, navigate to the Legacy Style Templates folder, select ENblack_theme.sty, and click OK.
Note: The Matrix view tab is only visible when a FOR field exists.
The TEXT dialog box opens.
Entertainment:
Entertainment appears in the Title column on the matrix.
Notice that the TAG row type is entered in the Row Type column. You can also select Tag from the Insert group and type the tag values into the dialog box.
By default, for a tag row, the tag values will display in the left on the report. However, you can change the row title on the report. In addition, if you want to use this row in calculations in the report, you can assign it a label to use as a name in the calculations.
The TAG dialog box opens.
Notice that the TAG row type is entered in the Row Type column. You can also select Tag from the Insert group and type the tag values into the dialog box.
The TAG dialog box opens.
The BAR dialog box opens.
The RECAP dialog box opens at the Options tab.
The TEXT dialog box opens.
Accessories:
Accessories: appears in the Title column on the matrix.
Notice that the TAG row type is entered in the Row Type column. You can also select Tag from the Insert group and type the tag values into the dialog box.
The TAG dialog box opens.
Notice that the TAG row type is entered in the Row Type column. You can also select Tag from the Insert group and type the tag values into the dialog box.
The TAG dialog box opens.
The BAR dialog box opens.
The RECAP dialog box opens at the Options tab.
The BAR dialog box opens.
The RECAP dialog box opens at the Options tab.
The syntax of the resulting financial report is shown in the following example.
Note: The page width of this document may cause the syntax to wrap onto multiple lines in the example below. In order to run the example, you must remove any line breaks in the name of the StyleSheet referenced by the INCLUDE statement.
TABLE FILE WF_RETAIL_SALES HEADING CENTER "Cost and Revenue" " " SUM COGS_US REVENUE_US FOR ID_PRODUCT "Entertainment:" OVER '2001' TO '2167' AS 'Stereo Systems' LABEL SS OVER '4012' TO '4018' AS 'Televisions' LABEL TV OVER BAR OVER RECAP TOTENT=SS + TV; AS 'Total Entertainment' OVER "Accessories:" OVER '5001' TO '5007' AS 'Headphones' LABEL HP OVER '5008' TO '5009' AS 'Remote Controls' LABEL RC OVER BAR OVER RECAP TOTACC=HP+RC; AS 'Total Accessories' OVER BAR OVER RECAP TOTAL=TOTENT+TOTACC; AS 'Total' ON TABLE NOTOTAL ON TABLE SET STYLE * INCLUDE = IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENblack_theme.sty, $ ENDSTYLE END
How to: |
The precision report is a report type that gives you an additional set of tools that make it easy to control the precise placement of objects and data in the report output. For example, with a precision report, you can quickly create a layout that is perfectly aligned for a preprinted form (like a Bill of Sale or a tax form) and that automatically breaks out one record per report page. Other benefits of precision reports include:
You can convert an existing report into a precision report or you can create a new precision report.
The following image shows an example of a precision report. Precision reports are built in the Precision Report canvas. You can output them in PDF, DHTML, and PostScript formats.
For more information on creating a precision report using the Precision Report canvas, see Accessing the Precision Reports Canvas.
The following example shows how to create a precision report showing Revenue by Vendor and Product Category.
The Report Wizard opens.
The Report canvas opens.
A styling warning message appears indicating that the report will be converted to a precision report. Click Yes to close the message and open the Precision Report canvas.
Note: Use the options in the Default Style group of the Tools tab to select the desired font, size, and style of the text.
The Precision Report canvas will appear similar to the following image.
You can create the precision report using the following WebFOCUS syntax, which you can type into a procedure using the Text Editor.
TABLE FILE WF_RETAIL SUM REVENUE_US BY BUSINESS_REGION BY PRODUCT_CATEGORY WHERE REVENUE_US GT 0; ON TABLE SUBHEAD "Revenue by <12 <BUSINESS_REGION " ON TABLE SET NEWLAYOUT ON ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * INCLUDE = endeflt, $ TYPE=TABHEADING, LINE=1, POSITION=(1.1 1), WRAP=ON, DIMENSION=(6 1), NAME=TEXT, FONT='ARIAL', COLOR='RED', $ TYPE=TABHEADING, OBJECT=TEXT, SIZE=15, STYLE=NORMAL ,$ TYPE=TABHEADING, OBJECT=FIELD, SIZE=15, STYLE=ITALIC ,$ $ TYPE=HEADING, OBJECT=Line, POSITION=(1.055556 1.402778), ENDPOINT=(4.3 1.4), NAME=LINE, BORDER-TOP=1.00, $ TYPE=DATAMATRIX, NAME=Data Matrix, POSITION=(1.1 1.5), DIMENSION=(5 3),$ ENDSTYLE END
You can retrieve information using the SQL reporting language, and can directly incorporate WebFOCUS formatting commands into the procedure. The following request uses the SQL SELECT statement to create a simple tabular report.
SQL SELECT BRANDTYPE, PRODUCT_CATEGORY, SUM(COGS_US), SUM(REVENUE_US) FROM WF_RETAIL GROUP BY BRANDTYPE, PRODUCT_CATEGORY; END
The output is:
The following request uses the ON TABLE HOLD FORMAT SQL_SCRIPT command to automatically generate a file containing an SQL SELECT statement that can be used as a subquery in another request. The request includes a WHERE phrase to exclude the Accessories product category.
TABLE FILE WF_RETAIL SUM MSRP_US BY PRODUCT_CATEGORY WHERE PRODUCT_CATEGORY NE 'Accessories' ON TABLE HOLD AS app1/sql1 FORMAT SQL_SCRIPT END
The following is the Master File that is generated by the ON TABLE HOLD FORMAT SQL_SCRIPT command:
FILENAME=SQL1, SUFFIX=SQLMSS , $ SEGMENT=SQL1, SEGTYPE=S0, $ FIELDNAME=PRODUCT_CATEGORY, ALIAS=E01, USAGE=A40V, ACTUAL=A40V, MISSING=ON, TITLE='Product,Category', $ FIELDNAME=MSRP_US, ALIAS=E02, USAGE=D20.2, ACTUAL=D8, MISSING=ON, TITLE='MSRP', $
The following is the Access File that is generated by the ON TABLE HOLD FORMAT SQL_SCRIPT command:
SEGNAME=SQL1, CONNECTION=wfretail, DATASET=APP1/SQL1.SQL, KEY=PRODUCT_CATEGORY, SUBQUERY=Y, $
The following is the SQL SELECT statement that is generated by the ON TABLE HOLD FORMAT SQL_SCRIPT command and that you can use as a subquery:
SELECT T18."PRODUCT_CATEGORY" AS "E01", SUM(T1."REVENUE_US") AS "E02", SUM(T1."COGS_US") AS "E03 FROM (wrd_wf_retail_sales T1 LEFT OUTER JOIN wrd_wf_retail_product T18 ON T18."ID_PRODUCT" = T1."ID_PRODUCT") GROUP BY T18."PRODUCT_CATEGORY"
The following is a TABLE request that uses the sql1 file:
TABLE FILE wf_retail SUM REVENUE_US BY PRODUCT_CATEGORY WHERE DB_INFILE(sql1, PRODUCT_CATEGORY, PRODUCT_CATEGORY) END
The following is the generated SQL request in which the sql1 file is used as a subquery:
SELECT T18."PRODUCT_CATEGORY", SUM(T1."REVENUE_US") FROM wrd_wf_retail_sales T1, wrd_wf_retail_product T18 WHERE (T18."ID_PRODUCT" = T1."ID_PRODUCT") AND (T18."PRODUCT_CATEGORY" IN (SELECT "E01" FROM (SELECT T18."PRODUCT_CATEGORY" AS "E01", SUM(T1."MSRP_US") AS "E02 FROM wrd_wf_retail_sales T1, wrd_wf_retail_product T18 WHERE (T18."ID_PRODUCT" = T1."ID_PRODUCT") AND (T18."PRODUCT_CATEGORY" <> 'Accessories') GROUP BY T18."PRODUCT_CATEGORY") S1)) GROUP BY T18."PRODUCT_CATEGORY ORDER BY T18."PRODUCT_CATEGORY";
The output is shown in the following image. Note that the Accessories product category is omitted from the report because of the subquery.