Amper Auto-Prompting

In this section:

 

The WebFOCUS amper auto-prompting facility enables you to create a launch page that prompts users for the amper variables necessary to execute a procedure. You can also design the launch page that will prompt for the amper variables.

With auto-prompting, you can add descriptions of procedures and variables, headings, default variable values, and static or dynamic lists. You can also select parameters and run a report while still being able to view and change your parameter selections. You can also display and hide parameters to widen the screen as needed.

You can even create a launch page that prompts users to select fields and then use these selections as the objects of the display and sort commands in the report request.

The following image shows a launch page that prompts you to select parameter values.

Note: The list controls in the autoprompt form display in the order the amper variables are coded in the procedure (FOCEXEC).

After you run the report, the output appears as shown in the following image:

From the amper-auto prompting launch page, you have the following options:

Option

Description

Run

Click this button to run the report.

Reset

Click this button to reset the parameter selections.

Clear Output

Click this button to clear the report output area.

Run in a new window

Select this check box to open the report in a new browser window.

Hide/Show Parameters

Double-click splitter bar to hide parameters for full screen report view. Double-click splitter bar again to return to the original parameters and report view.



x
Amper Auto-Prompting Considerations

The following are important amper auto-prompting issues to consider:


Top of page

x
Adding a Description of the Procedure

How to:

Note: The examples in the following topics are built on the preceding examples, and the code representing the concept being illustrated is shown in bold.

You can add a description of the procedure that provides information about the form, or what the purpose of the procedure is. The code that adds a description must be added before the report request. This is useful when the procedure is part of a web service.



x
Syntax: How to Add a Description of the Procedure
-<description>text</description>

where:

text

Is the description of the procedure. If the description requires multiple lines, you must repeat the <description> and </description> tags.



Example: Adding a Description of the Procedure

The following provides a description of the procedure. Note that this tag is only visible in the returned XML code.

							-<description>This procedure reports on Inventory </description>
-<description>by state, storename and product name. </description>
						
TABLE FILE CENTORD
SUM QTY_IN_STOCK BY STATE BY STORENAME BY PRODNAME
ON TABLE SUBHEAD
"Inventory Report"
WHERE STATE EQ '&STATE'
WHERE STORENAME EQ '&STORENAME'
WHERE PRODNAME EQ '&PRODNAME'
END

Top of page

x
Adding a Heading to the Form

How to:

You can add a heading to the form that explains to the user what information they need to provide. The code that adds a heading must be added before the report request.

Note: This functionality is available only when the launch page template is set to autoprompt_simple. For more information, see Customizing the Amper Auto-Prompting Facility.



x
Syntax: How to Add a Heading to the Prompt
-<heading> text </heading>

where:

text

Is the heading that will display on the form.



Example: Adding a Heading

The following provides a textual prompt for the form.

-<description>This procedure reports on Inventory </description>
-<description>by state, storename and product name. </description>
							-<heading> Please specify a state, storename and product name: </heading>
						
TABLE FILE CENTORD
SUM QTY_IN_STOCK BY STATE BY STORENAME BY PRODNAME
ON TABLE SUBHEAD
"Inventory Report"
WHERE STATE EQ '&STATE'
WHERE STORENAME EQ '&STORENAME'
WHERE PRODNAME EQ '&PRODNAME'
END

Top of page

x
Adding a Variable Description to the Form

How to:

You can add a description of a variable that will replace the variable name in the form that prompts the user for a value. The description is appended to the variable name in the WHERE or IF expression of the report request.



x
Syntax: How to Add a Variable Description to the Form
'&variable.description.'

where:

&variable

Is the variable name, including the ampersand (&), whose value is being prompted for.

description

Is a description of the variable that replaces the variable name in the prompt.

Note: The following are usage limitations for description values:

  • The ampersand (&) character is supported within the description for a variable by specifying the pipe character (|) immediately after the & character in the description.
  • The period (.) cannot be used in a description because a period is the delimiter to specify the beginning and end of the description value.
  • The open parenthesis character must have a space before it.



Example: Adding a Variable Description

The following provides a more descriptive name for the STATE, STORENAME, and PRODNAME fields within the form. The field descriptions will precede the field controls on the auto-prompt form.

-<description>This procedure reports on Inventory </description>
-<description>by state, storename and product name. </description>
-<heading> Please specify a state, storename and product name: </heading>
TABLE FILE CENTORD
SUM QTY_IN_STOCK BY STATE BY STORENAME BY PRODNAME
ON TABLE SUBHEAD
"Inventory Report"
WHERE STATE EQ '&STATE.2 letters for US State.'
WHERE STORENAME EQ '&STORENAME.Store Name.'
WHERE PRODNAME EQ '&PRODNAME.Product Name.'
END

Top of page

x
Setting a Default Variable Value

How to:

You can set a default variable value. This value will be used in the report if one is not supplied by the user. The code that specifies a default variable value must be added before the report request.



x
Syntax: How to Set a Default Variable Value
-DEFAULT variable=value
						

where:

variable

Is the variable, including the ampersand (&), for which you are setting a default value.

value

Is the default value for the variable.



Example: Setting a Default Variable Value

The following sets a default value of NY for the STATE field. Note that there must be an ampersand in front of the field name in the -DEFAULT command for the amper variable to contain a default attribute in the form.

-<description>This procedure reports on Inventory </description>
-<description>by state, storename and product name. </description>
-<heading> Please specify a state, storename and product name: </heading>
							-DEFAULT &STATE=NY
						
TABLE FILE CENTORD
SUM QTY_IN_STOCK BY STATE BY STORENAME BY PRODNAME
ON TABLE SUBHEAD
"Inventory Report"
WHERE STATE EQ '&STATE.2 letters for US State.'
WHERE STORENAME EQ '&STORENAME.Store Name.'
WHERE PRODNAME EQ '&PRODNAME.Product Name.'
END

Top of page

x
Setting a Hidden Variable

How to:

Dialogue Manager variables can be given default values using the -DEFAULT command. These variables are returned in the XML describe information used for WebFOCUS parameter prompting features (Amper Autoprompt, MR Publish Utility, HTML Composer, and ReportCaster Scheduling).

You can initialize a variable value and prevent it from being used for WebFOCUS parameter prompting by using the -DEFAULTH command. Variables initialized with -DEFAULTH are not used for parameter prompting. Since these variables are not displayed by the parameter prompting features, they are hidden from the user.

The code that specifies a default variable value must be added before the report request.



x
Syntax: How to Define and Initialize a Hidden Variable
-DEFAULTH variable=value
						

where:

variable

Is the name of the hidden variable.

value

Is the initial value for the variable.


Top of page

x
Adding a Single-Select List of Values

How to:

You can add a single-select list of values. The values in the list can be static or dynamic.



x
Syntax: How to Add a Static Single-Select List of Values
'&variable.(value,value2[,value3][,value4]...).[description.]'

where:

&variable

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

value, value2, value3, value4...

Are the values comprising the list of selectable variable values.

description

Is an optional description of the variable. For details and restrictions, see Adding a Variable Description to the Form.

Note: A static value cannot contain the comma character (,) when specified within the WHERE statement syntax because the comma character is the delimiter character for specifying a display value. When there is a comma in one or more static values, put the values in a file and use the dynamic list (FIND) functionality.



Example: Adding a Static Single-Select List of Values

The following provides a list of values that are valid for the STORENAME field. The user can select only one value from the list.

-<description>This procedure reports on Inventory </description>
-<description>by state, storename and product name. </description>
-<heading> Please specify a state, storename and product name: </heading>
-DEFAULT &STATE=NY
TABLE FILE CENTORD
SUM QTY_IN_STOCK BY STATE BY STORENAME BY PRODNAME
ON TABLE SUBHEAD
"Inventory Report"
WHERE STATE EQ '&STATE.2 letters for US State.'
WHERE STORENAME EQ '&STORENAME.(eMart,TV City,Web Sales).Store Name.'
WHERE PRODNAME EQ '&PRODNAME.Product Name.'
END


x
Syntax: How to Add a Dynamic Single-Select List of Values
'&variable.(FIND return_fieldname [,display_fieldname] IN datasource).[description.]'

where:

&variable

Is the variable, including the ampersand (&), for which you are supplying a list of 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 an MFD (Master File Description), 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 WF Client constructs the request to obtain the values using the specified data source. All environmental commands, such as SET commands, needed to obtain the values from the specified data source must be issued in the WebFOCUS Server profile, user profile, or WebFOCUS Client profile.

description

Is an optional description of the variable. For details and restrictions, see Adding a Variable Description to the Form.



Example: Adding a Dynamic Single-Select List of Values

The following provides a list of values that are valid for the product name field. This list is populated with values from the CENTORD data source. The user can select only one value from the list.

-<description>This procedure reports on Inventory </description>
-<description>by state, storename and product number. </description>
-<heading> Please specify a state, storename and product name: </heading>
-DEFAULT &STATE=NY
TABLE FILE CENTORD
SUM QTY_IN_STOCK BY STATE BY STORENAME BY PROD_NUM
ON TABLE SUBHEAD
"Inventory Report"
WHERE STATE EQ '&STATE.2 letters for US State.'
WHERE STORENAME EQ '&STORENAME.(eMart,TV City,Web Sales).Store Name.'
WHERE PROD_NUM EQ '&PROD_NUM.(FIND PROD_NUM,PRODNAME IN CENTORD).Product Name.'
END

Top of page

x
Adding a Multi-Select List of Values

How to:

Reference:

You can add a multi-select list of values. The values in the list can be static or dynamic.



x
Syntax: How to Add a Static Multi-Select List of Values

							&variable.({AND|OR}(<displayvalue1,value1>, <displayvalue2,value2>,...<displayvalueN,valueN>)).[description.]

where:

&variable

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

displayvalue, displayvalue2, displayvalue3, displayvalue4...

Are the values comprising the list of selectable variable values that you can select.

value, value2, value3, value4...

Are the values comprising the list of selectable variable values passed to the reporting server.

description

Is an optional description of the variable. For details and restrictions, see Adding a Variable Description to the Form.

Note: A static value cannot contain the comma character (,) when specified within the WHERE statement syntax because the comma character is the delimiter character for specifying a display value. When there is a comma in one or more static values, put the values in a file and use the dynamic list (FIND) functionality.



Example: Adding a Static Multi-Select List of Values

The following provides a list of values that are valid for the STORENAME field. The user can select more than one value from the list.

-<description>This procedure reports on Inventory </description>
-<description>by state, storename and product name. </description>
-<heading> Please specify a state, storename and product name: </heading>
-DEFAULT &STATE=NY
TABLE FILE CENTORD
SUM QTY_IN_STOCK BY STATE BY STORENAME BY PRODNAME
ON TABLE SUBHEAD
"Inventory Report"
WHERE STATE EQ '&STATE.2 letters for US State.'
WHERE STORENAME EQ &STORENAME.(OR(eMart,TV City,Web Sales)).Store Name.
WHERE PRODNAME EQ '&PRODNAME.Product Name.'
END


x
Syntax: How to Add a Dynamic Multi-Select List of Values
							&variable.({AND|OR}(FIND return_fieldname [,display_fieldname] IN datasource)).[description.]

where:

&variable

Is the variable, including the ampersand (&), for which you are supplying a list of 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 an MFD (Master File Description), 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 WF Client constructs the request to obtain the values using the specified data source. All environmental commands, such as SET commands, needed to obtain the values from the specified data source must be issued in the WebFOCUS Server profile, user profile, or WebFOCUS Client profile.

description

Is an optional description of the variable. For details and restrictions, see Adding a Variable Description to the Form.



Example: Adding a Dynamic Multi-Select List of Values

The following provides a list of values that are valid for the state field. This list is populated with values from the CENTORD data source. The user can select more than one value from the list.

-<description>This procedure reports on Inventory </description>
-<description>by store code, state and product name. </description>
-<heading> Please specify a storename, state and product name: </heading>
TABLE FILE CENTORD
SUM QTY_IN_STOCK BY STORE_CODE BY STATE BY PRODNAME
ON TABLE SUBHEAD
"Inventory Report"
WHERE STORE_CODE EQ &STORE_CODE.(OR(FIND STORE_CODE,STORENAME 
IN CENTORD)).Store Name.
WHERE STATE EQ &STATE.(OR(CA,IL,MA,NY,NJ,FL,TX)).2 letters for US State.
WHERE PRODNAME EQ '&PRODNAME.(FIND PRODNAME IN CENTORD).Product Name.'
END


x
Syntax: How to Add a Range of Values List
							&variable.(FROM Range1 TO Range2).

where:

&variable

Is the numerical variable, including the ampersand (&), for which you are supplying a list of values.

Range1

Is the starting numerical value of the range of list of values.

Range2

Is the ending numerical value of the range of list of values.



Example: Adding a Range of Values List

The following provides a list of numerical values that are valid for the QTY_IN_STOCK field. This list is populated with values from the CENTORD data source that fall within the range.

-<description>This procedure reports on Inventory </description>
-<description>by state, storename and product name. </description>
-<heading> Please specify a state, storename and product name: </heading>
TABLE FILE CENTORD
SUM QTY_IN_STOCK BY STATE BY STORENAME BY PRODNAME
ON TABLE SUBHEAD
"Inventory Report"
WHERE QTY_IN_STOCK GT &STOCK.(FROM 5000 TO 10000).
END


x
Reference: Rules for a Multi-Select List of Values


x
Reference: Selecting Values for Multi-Select Variables



x
Reference: Internal Processing of _FOC_NULL

When you select or manually code the No Selection option within a multi-select list, the parameter value sent to the WebFOCUS Server is _FOC_NULL, by default. Internal processing is then performed by the WebFOCUS Server Describe layer to search the procedure and selectively remove WebFOCUS phrases (such as BY and WHERE) or expressions that contain _FOC_NULL. The procedure is then passed to the core WebFOCUS engine to run the request.

The following is a WHERE example for selecting or manually coding the No Selection option that generates the _FOC_NULL value for dynamic multi-select lists:

WHERE CATEGORY EQ &CATEGORY.(OR(FIND CATEGORY IN MOVIES)).CATEGORY. AND DIRECTOR EQ &DIRECTOR.(OR(FIND DIRECTOR IN MOVIES)).DIRECTOR.;

If No Selection is returned for CATEGORY, the test for DIRECTOR will still be processed.

The following is a WHERE example for selecting or manually coding the No Selection option that generates the _FOC_NULL value for a static multi-select list and a dynamic multi-select list:

WHERE COPIES EQ 
&COPIES.(<No Selection,_FOC_NULL>,<1,1>,<2,2>,<3,3>).COPIES. 
AND DIRECTOR EQ &DIRECTOR.(OR(FIND DIRECTOR IN MOVIES)).DIRECTOR.;

Each list must be coded completely on a single line in the procedure.

When coding a HEADING, FOOTING, SUBHEAD, or SUBFOOT, you should have a minimum of one line that does not contain a parameter that could be assigned the value of _FOC_NULL.



x
Reference: Internal Processing of FOC_NONE

When you select or manually code the No Selection option within a multi-select list, the parameter value that may be sent to the WebFOCUS Server is FOC_NONE. Internal processing is then performed by the WebFOCUS Server Describe layer to search the procedure and remove all non-Dialogue Manager lines (do not begin with a dash ‘-’) that contain FOC_NONE. The procedure is then passed to the core WebFOCUS engine to run the request.

The following are WHERE examples for selecting or manually coding the No Selection option that generates the FOC_NONE value:

The following are FOC_NONE coding considerations:



x
Reference: Internal Processing of Select All

When you run a request with a static multi-select list, the Amper Autoprompt facility dynamically adds the Select All option to the list of values that, when selected, assigns all the values in the static multi-select list to the parameter. When the Select All and individual values are selected, the Select All value is ignored.

When Select All is selected, the parameter is assigned the value FOC_ALL. Internal processing is then done by the WebFOCUS Client Amper Autoprompt Facility to assign the parameter the select list values separated by the qualifier (AND or OR) specified in the WHERE statement that references the parameter.

The following example shows a WHERE statement using OR qualifier with static multi-select list for parameter &RATING. The parameter &RATING is referenced in the WHERE statement and in the HEADING. The HEADING shows how the parameter value is set to all values in the multi-select list separated by the OR qualifier.

TABLE FILE MOVIES
HEADING
" Ratings selected: "
" &RATING "
PRINT
     'MOVIES.MOVINFO.TITLE'
     'MOVIES.MOVINFO.COPIES'
BY 'MOVIES.MOVINFO.RATING'
BY 'MOVIES.MOVINFO.CATEGORY'
HEADING
""
FOOTING
""
							WHERE MOVIES.MOVINFO.RATING EQ &RATING.(OR(<General Audience,G>,
  <Not Rated,NR>,<Parental Guidance,PG>,<PG Over 13,PG13>,
  <R Over 18,R>)).Rating.;
						
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
$
TYPE=TITLE,
     STYLE=BOLD,
$
TYPE=HEADING,
     SIZE=12,
     STYLE=BOLD,
$
ENDSTYLE
END

The following image shows the Amper Autoprompt form and report when Select All is selected.

The WebFOCUS Client assigns &RATING the list of values by creating and adding the following syntax to the request sent to the reporting server:

 -SET &RATING='''G'' OR ''NR'' OR ''PG'' OR ''PG13'' OR ''R'''; 

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 data source. All environmental commands, such as SET commands, needed to obtain the values from the specified data source 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 data source. All environmental commands, such as SET commands, needed to obtain the values from the specified data source 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 data source. All environmental commands, such as SET commands, needed to obtain the values from the specified data source 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:


Top of page

x
Customizing the Amper Auto-Prompting Facility

You can customize the look and feel of the amper auto-prompting facility by editing the launch page template file you are using. All of the available launch page templates are located in the ibi\WebFOCUS80\ibi_apps\ibi_html\javaassist\ibi\html\describe directory. The default template is autoprompt_top.css.

If you want to customize the banner, create an image, save it in the describe directory, and change the background-image property, which is shown in bold type in the following Cascading Style Sheet (CSS) code:

#idBannerDiv {
height:41px; 
background-image:url(style/logo_banner_TOP.gif); 
background-position:top left;
background-repeat:no-repeat; 
margin:0px;
margin-top:0px;
cursor:pointer; }

The option to select different launch page templates can be set in the WebFOCUS Administration Console using the Parameter Prompting selection under Client Settings, where you can set the IBIF_describe_xsl value to one of the launch page templates.

You can also enter the name of the desired launch page template in a FOCEXEC using the following code:

<describe_xsl>template</describe_xsl>

where:

template

Is set to one of the following launch page template values:

  • autoprompt_top. Displays the parameters horizontally at the top of the page and is the default template value.
  • autoprompt_top_checked. Is the same as autoprompt_top, but the Run in a new window check box is preselected.
  • autoprompt. Displays the parameters vertically at the left side of the page.
  • autoprompt_checked. Is the same as autoprompt, but the Run in a new window check box is preselected.
  • autoprompt_simple. Is the basic input form.

Top of page

x
Specifying Amper Auto-Prompting Settings in a URL to Run a Report

You can specify amper auto-prompting settings directly in a URL to run a report. The WebFOCUS Client configuration settings that you can specify for parameter prompting are as follows:

The possible values for both of these settings are:

When a request is sent to the WebFOCUS Client to run a report, the WebFOCUS Client adds the following parameter to the request sent to the WebFOCUS Reporting Server:

WFDESCRIBE=value
				

where:

WFDESCRIBE

Communicates to the WebFOCUS Reporting Server the required level of parameter prompting evaluation.

value

Is the value of the WebFOCUS Client configuration parameter prompting setting, which can be specified in the URL sent to the WebFOCUS Client to run the report request using the IBIF_wfdescribe setting. The IBIF_wfdescribe setting is used on the URL for both self-service and Managed Reporting requests.

You can use the WebFOCUS Client variable IBIC_server to specify the server node for the report. For more information about IBIC_server, see the WebFOCUS Security and Administration manual.

The following is an example of a URL used to run a WebFOCUS Reporting Server procedure named movies on the Reporting Server node EDASERVE with IBIF_wfdescribe set to XMLRUN:

http://hostname[:port]/ibi_apps/WFServlet?IBIF_ex=movies
&IBIC_server=EDASERVE&IBIF_wfdescribe=XMLRUN

Note: Changes to the parameter prompting configuration setting should be evaluated in a development or test environment, and the evaluation should include running existing reports and applications.

For more information about IBIF_wfdescribe, see the Changing WebFOCUS Client Settings in the WebFOCUS Administration Console topic in the WebFOCUS Client Core Processing Details chapter of the WebFOCUS Security and Administration manual.

For more information about IBIMR_prompting, see Changing Managed Reporting Settings, in the Managed Reporting Settings in the WebFOCUS Administration Console topic within the Managed Reporting Processing Details chapter of the WebFOCUS Security and Administration manual.


WebFOCUS