Customizing the Page Range on the Pagination Bar

How to:

The default string and parameters used to display the page range on the pagination bar of an active report are stored on the WebFOCUS Reporting Server in a file supplied with your software. Instead of using the default values stored on the server, you can specify your own customization values within an individual active report procedure, using the TABLE_JS syntax described in this topic. The values specified in the TABLE_JS code will overwrite the default values, and the customized page range on the pagination bar will be displayed in the active report output.

This feature eliminates the need for the creation and management of multiple customized files used in many applications. If you have already made page range customizations using the files available with your software, the customizations specified in the TABLE_JS code will overwrite them.

Note:

Syntax: How to Customize the Page Range on the Pagination Bar

The syntax is

*TABLE_JS
 "strings":
{ "paglinetext":"customized_string" }
*END

where:

customized_string

Are the parameters that you supply to customize the page range on the pagination bar. Valid values are described in the following table.

Parameter

Description

%inds

Displays the current page number and allows you to type over it with the number of a page to go to.

%ind

Displays the current page number. Does not allow you to type a go-to page number.

%frcs

Is the number of the first record that is displayed. It is a cumulative number from the first record on the first page, up to the first record on the current page.

%lrcs

Is the number of the last record that is displayed. It is a cumulative number from the first record on the first page, up to the last record on the current page.

%trcs

Is the total number of records.

%pers

Is the percentage of the total records that are displayed when a filter is applied.

%pgs

Is the total number of pages.

%rcs

Is the total number of records when a filter is applied.

%tn

Is a table number used only for internal purposes.

Example: Customizing the Page Range on the Pagination Bar

The following active report procedure uses TABLE_JS code to overwrite the default page range on the pagination bar.

In this example, the number of records displayed on each report page is set in the report procedure by the WebFOCUS StyleSheet attribute LINES-PER-PAGE. You can also set the number of records (lines) per page in the GUI for and App Studio. For more information on the GUI procedure, see the manual for the graphical tool that you are using.

The LINES-PER-PAGE and TABLE_JS code are shown in bold in the example.

Note: If you want to run the example in this procedure, you must combine the two lines of code between the braces in the TABLE_JS block, so that they are a single line of code, as required by the syntax rules.

TABLE FILE CAR
PRINT
     CAR.BODY.DEALER_COST
     CAR.BODY.RETAIL_COST
     CAR.BODY.SALES
BY  LOWEST CAR.ORIGIN.COUNTRY
BY  LOWEST CAR.COMP.CAR
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT AHTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
$
TYPE=REPORT,
     LINES-PER-PAGE=10,
     ARGRAPHENGINE=JSCHART,
     ALLOW-TOOLS=OFF,
$

*TABLE_JS
 "strings":
{ "paglinetext":"%frcs - %lrcs out of %trcs records, Page %inds of 
%pgs<span id='smsg%tn'></span>" } 
*END


ENDSTYLE
END

At run time, the preceding code generates the following pagination bar on the active report. The underscore in Page 1 indicates that you can type a go-to page number here.

To remove the capability to type a go-to page number, use the %ind parameter instead of the %inds parameter in the TABLE_JS block, as shown here.

*TABLE_JS
 "strings":
{ "paglinetext":"%frcs - %lrcs out of %trcs records, Page %ind of %pgs<span id='smsg%tn'></span>" } 
*END

The active report will display the following pagination bar, with no underscore in Page 1.

WebFOCUS

Feedback