Controlling the Display of Sorted Data With Accordion Reports

In this section:

Accordion Reports provide a way to control the amount of sorted data that appears on an HTML report page. You can produce reports with expandable views for each vertical sort field in a request with multiple BY fields.

You can create two types of Accordion Reports:

Two vertical sort fields coded with BY phrases are required when using Accordion Reports. If the command syntax does not contain at least two BY phrases, the Accordion Reports EXPANDABLE or EXPANDBYROW command is ignored, no message is generated, and a standard HTML report is created.

Note: Accordion Reports are only supported for HTML report output.


Top of page

x
Requirements for Accordion Reports

Reference:

The following requirements must be taken into consideration when creating Accordion Reports:



x
Reference: Distributing Accordion Reports With ReportCaster

Distributing Accordion Reports with ReportCaster requires the use of JavaScript components and images located on the WebFOCUS Client. To access the JavaScript components and images from a report distributed by ReportCaster, the scheduled procedure must contain the SET FOCHTMLURL command, which must be set to an absolute URL instead of the default value. For example,

SET FOCHTMLURL = http://hostname[:port]/ibi_html

where:

hostname[:port]
Is the host name and optional port number (specified only if you are not using the default port number) where the WebFOCUS Web application is deployed.
ibi_html
Is the site-customized Web server alias pointing to the WebFOCUS77/ibi_html directory (where ibi_html is the default value).

For more information about coding reports for use with ReportCaster, see the Tips and Techniques for Coding a ReportCaster Report appendix in your ReportCaster manual.


Top of page

x
Creating an Accordion By Row Report

How to:

Reference:

Accordion By Row reports are HTML reports that offer an interactive interface to data aggregated at multiple levels by presenting the sort fields within an expandable tree. The highest dimension or sort field (BY value) and the aggregated measures for each value display at the top of the report. The tree control can be used to open or close each dimension and view the associated aggregated values. Clicking the plus sign next to a sort field value opens new rows that display the next lower level sort field values and subtotals. The lowest level sort field, when expanded, displays the aggregated data values.

Using the SET EXPANDBYROW command and turning HTMLCSS ON enables any single verb SUM (WRITE, ADD) or COUNT to be turned into an Accordion By Row request. EXPANDBYROW automatically invokes the SET SUBTOTALS=ABOVE command, which moves the subtotal rows above the subheading and data rows. A SUB-TOTAL command is automatically added for the next-to-last BY field. Each level will be presented at the aggregated level, and the data values will represent the aggregation of the lowest level BY.

Pop-up field descriptions are supported for the fields within the BY tree and will present the field descriptions maintained within the Master File or defined associated with the fields.

Styling an Accordian By Row report can be done using standard HTML report techniques, but it is important to keep the report structure in mind. All rows except the lowest level are actually SUBTOTAL rows and the lowest level contains the report DATA.

Accordion reports created with the SET EXPANDABLE command open by column, not row.



x
Syntax: How to Create Accordion Reports That Expand by Row
SET EXPANDBYROW = {OFF|ON|n}
ON TABLE SET EXPANDBYROW {OFF|ON|n}

where:

OFF
Does not create an accordion report. OFF is the default value.
ON
Creates an accordion report which initially displays only the highest sort field level. To see rows on lower levels, click the plus sign next to one of the displayed sort field values.
ALL
Creates an accordion report in which all sort field levels are initially expanded. To roll up a sort field level, click the minus sign next to one of the sort field values on that level.
n
Creates an accordion report in which n sort field levels are initially expanded. To roll up an expanded sort field level, click the minus sign next to one of the sort field values on that level.

Note: Accordion By Row reports require that the HTMLCSS parameter be set to ON.



Example: Creating an Accordion By Row Report

The following request against the GGSALES data source has four sort fields, REGION, ST, CATEGORY, and PRODUCT:

SET EXPANDBYROW=ON
TABLE FILE GGSALES
SUM BUDUNITS UNITS BUDDOLLARS DOLLARS 
BY REGION 
BY ST 
BY CATEGORY 
BY PRODUCT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
GRID=OFF,FONT=ARIAL,$
END

The initial output shows only the top level BY field (REGION):

Clicking the plus sign next to the Midwest region opens the rows that show the states associated with that region:

Clicking the plus sign next to the state IL opens the rows that show the categories associated with that state:

Clicking the plus sign next to the Coffee category shows the products associated with that category. This is the lowest level of the Accordion By Row report:



x
Reference: Usage Notes for SET EXPANDBYROW

The following features are not supported with Accordion By Row reports and will automatically turn EXPANDBYROW to OFF:

The BORDER feature is not supported with Accordion By Row reports and will be ignored in an EXPANDBYROW report.


Top of page

x
Creating an Accordion By Column Report

How to:

Reference:

Accordion By Column reports do not automatically display entire report rows. A plus sign appears to the left of each data value in the column under the highest-level sort heading. For data associated with lower-level sort fields, a plus sign is placed to the left of each data value, but the data does not appear unless manually expanded. Data values of the lowest-level sort field are not expandable. To expand your view of data for any expandable sort field, click a plus sign and all data associated with the next lower-level sort field appears. When you expand a data value under the next to lowest sort heading, all of the remaining associated data values in the report appear. This type of Accordion Report is generated using the SET EXPANDABLE command.



x
Reference: Support for Accordion By Column Reports

The following commands are not supported when using Accordion Reports:

BORDER, COLUMN, FOR, IN, OVER, PAGE-NUM, ROW-TOTAL, TOTAL

Data Visualization, HTML BYTOC, OLAP, On Demand Paging (WebFOCUS Viewer), column freezing, and the ReportCaster burst feature are also not supported with Accordion Reports.



x
Syntax: How to Create Accordion by Column Reports

To enable Accordion By Column Reports, specify the following

ON TABLE SET EXPANDABLE = {ON|OFF}

where:

ON
Enables Accordion By Column Reports.
OFF
Disables Accordion By Column Reports. OFF is the default value.


Example: Creating an Accordion By Column Report

This example shows how to use an EXPANDABLE command to create an Accordion By Column Report.

TABLE FILE GGSALES
SUM UNITS DOLLARS
BY REGION BY ST BY CITY BY CATEGORY
ON TABLE SET EXPANDABLE ON
END

The following image shows an Accordion by Column Report which displays all data associated with the first-level sort field, Region, by default. The expanded data values you see are the result of a report user clicking plus signs to the left of specific first, second- and third-level sort fields after the report is generated.


WebFOCUS