WebFOCUS Amper Autoprompt Facility Field Selection Enhancement

In this section:

The WebFOCUS amper auto-prompting facility now enables you to create a launch page that prompts users to select one or more fields to apply to each display and sort command in a report request. The list controls in the autoprompt form display in the order the amper variables are coded in the procedure (FOCEXEC).


Top of page

x
Adding Static Lists of Display and Sort Fields

How to:

In a static list of fields, you specify the field names and display values in the select list for the display or sort command.



x
Syntax: How to Add a Static Single-Select List of Sort or Display Fields
cmd &var.(<dsply1[,val1>],<dsply2[,val2>],...<dsplyN[,valN>]).[desc.]

where:

cmd

Is the command to which the list of fields will apply. Valid values are PRINT, COUNT, SUM, WRITE, ADD, BY, and ACROSS.

&var

Is the variable, including the ampersand, for which you are supplying a list of field values.

dsply1, dsply2, ...

Are the entries that display on the launch page. Selecting an entry automatically selects the corresponding field.

val1, val2, ...

Are the field names passed to the Reporting Server. They can be qualified field names and can be omitted if the display value is identical to the field name.

desc

Is an optional description of the variable.

Note: The entire command, up to and including the description, if there is one, must appear on one line of the report request.



Example: Adding Single-Select Lists of Sum Fields and Sort Fields

The following request against the GGSALES data source enables the user to select one of the following from each list when running the procedure:

TABLE FILE GGSALES
HEADING
"Sales Report Summary for: "
"Fields: &SumFlds"
"Sort: &SortBy"
"Across: &Acrs"
" "
SUM &SumFlds.(<Sales,DOLLARS>,<Budget,BUDDOLLARS>,<Units,UNITS>).Sum.
BY &SortBy.(<Category,GGSALES.SALES01.CATEGORY>,<PRODUCT>).By.
ACROSS &Acrs.(<Area,REGION>,<State,ST>,<None,FOC_NONE>).Across.
WHERE REGION NE 'West'
ON TABLE SET PAGE NOPAGE
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, FONT=ARIAL,SIZE=10,SQUEEZE=ON,$
TYPE=HEADING, FONT=ARIAL, STYLE=BOLD, JUSTIFY=LEFT,$
TYPE=HEADING, LINE=1, FONT=ARIAL, STYLE=BOLD, JUSTIFY=LEFT,$
TYPE=TITLE, BACKCOLOR=BLACK, COLOR=WHITE,$
TYPE=ACROSSTITLE, BACKCOLOR=LIGHT BLUE, COLOR=BLUE,$
TYPE=ACROSSVALUE, BACKCOLOR=LIGHT GRAY, COLOR = GREEN,$
END

Running the request opens the following launch page on which the selection for the REGION sort field displays as Area, the selection for the DOLLARS field displays as Sales, the selection for the CATEGORY sort field and the BUDDOLLARS and UNITS fields display in mixed-case, and the display value for PRODUCT is the same as the sort field name. Only one selection is allowed from each list:

Selecting Sales, Category, and None produces the following report:



x
Syntax: How to Add a Static Multi-Select List of Sort Fields
cmd &var.(cmd(<dsply1[,val1>],<dsply2[,val2>],...<dsplyN[,srtN>])).[desc.]

where:

cmd

Is the command to which the list of fields will apply. Valid values are BY and ACROSS. Adding the command around the select list creates a multi-select list.

&var

Is the variable, including the ampersand, for which you are supplying a list of field values.

dsply1, dsply2, ...

Are the entries that display on the launch page. Selecting an entry automatically selects the corresponding sort field.

val1, val2, ...

Are the field names passed to the reporting server. They can be qualified field names and can be omitted if the display value is identical to the field name.

desc

Is an optional description of the variable.

Note: The entire command, up to and including the description, if there is one, must appear on one line of the report request.



x
Syntax: How to Add a Static Multi-Select List of Display Fields
cmd &var.(AND(<dsply1[,val1>],<dsply2[,val2>],...<dsplyN[,srtN>])).[desc.]

where:

cmd

Is the command to which the list of fields will apply. Valid values are PRINT, COUNT, SUM, WRITE, and ADD.

&var

Is the variable, including the ampersand, for which you are supplying a list of field values.

AND

Is the connector that creates a multi-select list.

dsply1, dsply2, ...

Are the entries that display on the launch page. Selecting an entry automatically selects the corresponding sort field.

val1, val2, ...

Are the field names passed to the reporting server. They can be qualified field names and can be omitted if the display value is identical to the field name.

desc

Is an optional description of the variable.

Note: The entire command, up to and including the description, if there is one, must appear on one line of the report request.



Example: Adding Multi-Select Lists of Sum Fields and Sort Fields

The following request against the GGSALES data source enables the user to select one or more of the following when running the procedure:

TABLE FILE GGSALES
HEADING
"Sales Report Summary for: "
"Fields: &SumFlds"
"Sort: &SortBy"
"Across: &Acrs"
" "
SUM &SumFlds.(AND(<Sales,DOLLARS>,<Budget,BUDDOLLARS>,<Units,UNITS>)).Sum.
BY &SortBy.(BY(<Category,GGSALES.SALES01.CATEGORY>,<PRODUCT>)).By.
ACROSS &Acrs.(ACROSS(<Area,REGION>,<State,ST>,<None,FOC_NONE>)).Across.
WHERE REGION NE 'West'
ON TABLE SET PAGE NOPAGE
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, FONT=ARIAL,SIZE=10,SQUEEZE=ON,$
TYPE=HEADING, FONT=ARIAL, STYLE=BOLD, JUSTIFY=CENTER,$
TYPE=HEADING, LINE=1, FONT=ARIAL, STYLE=BOLD, JUSTIFY=CENTER,$
TYPE=TITLE, BACKCOLOR=BLACK, COLOR=WHITE,$
TYPE=ACROSSTITLE, BACKCOLOR=LIGHT BLUE, COLOR=BLUE,$
TYPE=ACROSSVALUE, BACKCOLOR=LIGHT GRAY, COLOR = GREEN,$
END

Running the request opens the following launch page on which the selection for the REGION sort field displays as Area, the selection for the DOLLARS field displays as Sales, the selection for the CATEGORY sort field and the BUDDOLLARS and UNITS fields display in mixed-case, and the display value for PRODUCT is the same as the sort field name:

Selecting Sales, Units, Category, and Area produces the following report:


Top of page

x
Adding Dynamic Lists of Display and Sort Fields

How to:

Reference:

In a dynamic list of fields, you use the FIND command in the select list to retrieve field names and display values from a FOCUS data source.



x
Reference: Creating Data Sources Containing Field Names

The following examples create three data sources to be used in the examples that create dynamic field lists:



Example: Creating the GGDETFLD Data Source

The following procedure creates the FOCUS data source named GGDETFLD:

APP HOLD IBISAMP
DEFINE FILE SYSCOLUM
FLDDESC/A20=IF NAME EQ 'DOLLARS' THEN 'Dollars' ELSE IF NAME EQ 'BUDDOLLARS' THEN 'Budget' ELSE IF NAME EQ 'UNITS' THEN 'Units' ELSE 'N/A';
END
TABLE FILE SYSCOLUM
PRINT FLDDESC
BY NAME
WHERE TBNAME EQ 'GGSALES'
WHERE NAME EQ 'DOLLARS' OR 'BUDDOLLARS' OR 'UNITS'
ON TABLE HOLD AS GGDETFLD FORMAT FOCUS
END


Example: Creating the GGBYFLD Data Source

The following procedure creates the FOCUS data source named GGBYFLD:

APP HOLD IBISAMP
DEFINE FILE SYSCOLUM
FLDDESC/A20=IF NAME EQ 'CATEGORY' THEN 'Category' ELSE IF NAME EQ 'PRODUCT' THEN 'Product' ELSE 'N/A';
END
TABLE FILE SYSCOLUM
PRINT FLDDESC
BY NAME
WHERE TBNAME EQ 'GGSALES'
WHERE NAME EQ 'CATEGORY' OR 'PRODUCT'
ON TABLE HOLD AS GGBYFLD FORMAT FOCUS
END


Example: Creating the GGACRFLD Data Source

The following procedure creates the FOCUS data source named GGACRFLD:

APP HOLD IBISAMP
DEFINE FILE SYSCOLUM
FLDDESC/A20=IF NAME EQ 'REGION' THEN 'Region' ELSE IF NAME EQ 'ST' THEN 'State' ELSE 'N/A';
END
TABLE FILE SYSCOLUM
PRINT FLDDESC
BY NAME
WHERE TBNAME EQ 'GGSALES'
WHERE NAME EQ 'REGION' OR 'ST'
ON TABLE HOLD AS GGACRFLD FORMAT FOCUS
END


x
Syntax: How to Add a Dynamic Single-Select List of Display or Sort Fields
cmd &var.(FIND return_fieldname [,display_fieldname] IN datasource).[description.]

where:

cmd

Is the command to which the list of fields will apply. Valid values are PRINT, COUNT, SUM, WRITE, ADD, BY, and ACROSS.

&var

Is the variable, including the ampersand, for which you are supplying a list of field values.

return_fieldname

Is the name of the field containing the possible variable values that are returned to the FOCEXEC.

display_fieldname

Is the name of the field containing the possible variable values that are displayed in the auto-prompt form.

Note: Both return_fieldname and display_fieldname can be a DEFINE field in a Master File, but not a DEFINE field in a procedure.

datasource

Is the data source that contains the fields specified in return_fieldname and display_fieldname. If the fields reside in a cross-reference file of a data source used in a join, use the data source name that contains the fields.

Note: For dynamic lists, the WebFOCUS Client constructs the request to obtain the values using the specified datasource. All environmental commands, such as SET commands, needed to obtain the values from the specified datasource must be issued in the WebFOCUS Server profile, user profile, or WebFOCUS Client profile.

description

Is an optional description of the variable.



Example: Creating Dynamic Single-Select Lists of Display and Sort Fields

The following request against the GGSALES data source creates three single-select dynamic lists by retrieving field names from the FOCUS data sources GGDETFLD, GGBYFLD, and GGACRFLD:

TABLE FILE GGSALES
HEADING
"Sales Report Summary for: "
"Fields: &SumFlds"
"Sort: &SortBy"
"Across: &Acrs"
" "
SUM &SumFlds.(FIND NAME, FLDDESC IN GGDETFLD).Sum Fields.
BY &SortBy.(FIND NAME, FLDDESC IN GGBYFLD).By.
ACROSS &Acrs.(FIND NAME, FLDDESC IN GGACRFLD).Across.
WHERE REGION NE 'West'
ON TABLE SET PAGE NOPAGE
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, FONT=ARIAL,SIZE=10,SQUEEZE=ON,$
TYPE=HEADING, FONT=ARIAL, STYLE=BOLD, JUSTIFY=CENTER,$
TYPE=HEADING, LINE=1, FONT=ARIAL, STYLE=BOLD, JUSTIFY=CENTER,$
TYPE=TITLE, BACKCOLOR=BLACK, COLOR=WHITE,$
TYPE=ACROSSTITLE, BACKCOLOR=LIGHT BLUE, COLOR=BLUE,$
TYPE=ACROSSVALUE, BACKCOLOR=LIGHT GRAY, COLOR = GREEN,$
END

Running the request opens the following launch page with single-select lists for the SUM, BY, and ACROSS commands:

Selecting Dollars on the Sum Fields drop-down list, Category on the By drop-down list, and Region on the Across drop-down list produces the following report:



x
Syntax: How to Add a Dynamic Multi-Select List of Sort Fields
cmd &var.(cmd(FIND return_fieldname [,display_fieldname] IN datasource)).[description.]

where:

cmd

Is the command to which the list of fields will apply. Valid values are BY and ACROSS. Adding the command around the select list creates a multi-select list of values.

&var

Is the variable, including the ampersand, for which you are supplying a list of field values.

return_fieldname

Is the name of the field containing the possible variable values that are returned to the FOCEXEC.

display_fieldname

Is the name of the field containing the possible variable values that are displayed in the auto-prompt form.

Note: Both return_fieldname and display_fieldname can be a DEFINE field in a Master File, but not a DEFINE field in a procedure.

datasource

Is the data source that contains the fields specified in return_fieldname and display_fieldname. If the fields reside in a cross-reference file of a data source used in a join, use the data source name that contains the fields.

Note: For dynamic lists, the WebFOCUS Client constructs the request to obtain the values using the specified datasource. All environmental commands, such as SET commands, needed to obtain the values from the specified datasource must be issued in the WebFOCUS Server profile, user profile, or WebFOCUS Client profile.

description

Is an optional description of the variable.



x
Syntax: How to Add a Dynamic Multi-Select List of Display Fields
cmd &var.(AND(FIND return_fieldname [,display_fieldname] IN
datasource)).[description.] 

where:

cmd

Is the command to which the list of fields will apply. Valid values are PRINT, COUNT, SUM, WRITE, and ADD.

&var

Is the variable, including the ampersand, for which you are supplying a list of field values.

AND

Is the connector that creates a multi-select list.

return_fieldname

Is the name of the field containing the possible variable values that are returned to the FOCEXEC.

display_fieldname

Is the name of the field containing the possible variable values that are displayed in the auto-prompt form.

Note: Both return_fieldname and display_fieldname can be a DEFINE field in a Master File, but not a DEFINE field in a procedure.

datasource

Is the data source that contains the fields specified in return_fieldname and display_fieldname. If the fields reside in a cross-reference file of a data source used in a join, use the data source name that contains the fields.

Note: For dynamic lists, the WebFOCUS Client constructs the request to obtain the values using the specified datasource. All environmental commands, such as SET commands, needed to obtain the values from the specified datasource must be issued in the WebFOCUS Server profile, user profile, or WebFOCUS Client profile.

description

Is an optional description of the variable.



Example: Creating Dynamic Multi-Select Lists of Display and Sort Fields

The following request against the GGSALES data source creates three multi-select dynamic lists by retrieving field names from the FOCUS data sources GGDETFLD, GGBYFLD, and GGACRFLD:

TABLE FILE GGSALES
HEADING
"Sales Report Summary for: "
"Fields: &SumFlds"
"Sort: &SortBy"
"Across: &Acrs"
" "
SUM &SumFlds.(AND(FIND NAME, FLDDESC IN GGDETFLD)).Sum Fields.
BY &SortBy.(BY(FIND NAME, FLDDESC IN GGBYFLD)).By.
ACROSS &Acrs.(ACROSS(FIND NAME, FLDDESC IN GGACRFLD)).Across.
WHERE REGION NE 'West'
ON TABLE SET PAGE NOPAGE
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, FONT=ARIAL,SIZE=10,SQUEEZE=ON,$
TYPE=HEADING, FONT=ARIAL, STYLE=BOLD, JUSTIFY=CENTER,$
TYPE=HEADING, LINE=1, FONT=ARIAL, STYLE=BOLD, JUSTIFY=CENTER,$
TYPE=TITLE, BACKCOLOR=BLACK, COLOR=WHITE,$
TYPE=ACROSSTITLE, BACKCOLOR=LIGHT BLUE, COLOR=BLUE,$
TYPE=ACROSSVALUE, BACKCOLOR=LIGHT GRAY, COLOR = GREEN,$
END

Running the request opens the following launch page with multi-select lists for the SUM, BY, and ACROSS commands. Note that No Selection is automatically added to each list:

Selecting Dollars, Units, Category, and Region produces the following report:


WebFOCUS