In this section: |
The Procedure View panel contains the panel customization commands and the Procedure View tree. This panel displays all components in a procedure. You can add new components to a procedure, such as a Report, Define, Define Function, Chart, Set, Join, Use, and others.
If a component in the procedure is open, a green arrow appears next to the component icon.
When a new procedure is created, the Comment component opens automatically. In a previously created procedure that is reopened, the last report component or chart component opens automatically.
The Procedure View panel is available when you create or open a procedure or report. The Procedure View panel is shown in the following image.
For more information on customizing the Procedure View panel, see Customizing WebFOCUS App Studio Panels.
The Procedure View tree displays the components and folders associated with a procedure.
Displays different options depending on the selected component or components in the procedure.
Shows the components in a procedure.
In this section: |
A procedure is a .fex file that defines how data is retrieved and displayed. Procedures request data from the data source using a Master File to understand how the data is organized. When you run a procedure, it executes a series of commands that process your data and transform it into a readable output.
Procedures can consist of the following components:
You can add these components to new or existing procedures, and are responsible for the order in which you add them. For more information, see Order of Components in the Procedure View Panel. The following topics describe how these components modify a procedure.
You can add a report to a procedure. In report mode, you can create and style simple or complex reports, add data to the Report canvas, and style that data creating a graphical representation of the report page. This allows you to view how the report displays at run time.
The MAGNIFY Engine canvas contains the following ENGINE SET statements which are available for selection.
The Engine component exposes the WebFOCUS ENGINE SET statement and enables you to enter ENGINE commands or connection attributes, and override parameters.
Note: The Engine component is only used to create ENGINE statements. You are responsible for having the knowledge of the ENGINE SET command or the Connection Attribute needed.
The SQL Report component launches the SQL Report Wizard, where you can create a new SQL report, create an SQL report from an external .sql file, pass SQL commands to an RDBMS using SQL passthru, or import SQL commands from an existing .sql file.
You can use the Define feature to create a virtual field as a component in a procedure.
Note: To enable the objects when creating a Define, click the New button.
A virtual field is evaluated on each retrieved record that passes any selection criteria on real fields. Define the virtual field by assigning a format and typing an expression, or composing it using the calculator fields and functions. The result of the expression is treated as though it were a real field stored in the data source.
You are able to create your own functions by using the Define Function Wizard. The Define Function Wizard assists in the creation of a user function. The created functions can later be retrieved through the Function Arguments dialog box, using the Retrieve User Functions button. By clicking Retrieve User Functions, your created functions will be available for use.
You can add the Set component to a procedure to select Environment Parameters and customize the procedures. The Set component controls the way that reports and charts appear on the screen or printer, the content of reports and charts, data retrieval characteristics that affect performance, and system responses to user requests. It also helps you set up your metadata and manipulate information, such as dates. For more information about SET parameters, see the Developing Reporting Applications technical content.
If a report requires data from two or more related data sources, you can temporarily join the files and report from them as if they were one. Joined files remain physically separate, but are treated as one data source structure.
The Join component provides a graphical method for creating and manipulating all types of Joins. To create a Join, you must specify a host data source, and then a cross-referenced data source. Both host and cross-referenced files are Master Files.
You create the Join as an component that is separate from any other component or procedure. You are responsible for placing the Join object in the correct position within your procedure, (that is, before a Define, Report, or Chart), and running it. The Join remains active for the entire session, unless you explicitly clear it.
When you access a WebFOCUS data file, WebFOCUS searches for a Master File with the specified file name, and then searches for a data source with the same name. With the Use component, you can specify the name and location of a WebFOCUS data source.
You can apply the Use component to a procedure in WebFOCUS App Studio when the default naming convention is not used, the data source cannot be found in the standard search path, or an explicit extra option is desired.
When you identify a WebFOCUS data source with the Use component, a Use directory is created, which is a list of data source definitions. When a Use directory is in effect, WebFOCUS locates a data source using the information in the directory instead of searching for it using the default name and search path. A Use directory enables you to access up to 1022 data sources and applies only to WebFOCUS data sources.
For a file managed by the operating system, such as a comma-delimited data file, the physical file name is the actual name of a file as it appears to the operating system. A logical name is the shorthand name that points to a physical file name. Logical names simplify code by allowing short names to be used in place of the longer physical file name.
With the Allocation Wizard, you can create a FILEDEF command and generate platform independent file paths for all portable platforms by creating FILEDEF syntax with application names.
The Execute component allows one procedure to execute or call another procedure. The called procedure behaves as a completely separate procedure, with its own context. The Execute component allows you to view and select available procedures, supply values for parameters in the called procedure, and test the called procedure.
Once this procedure is specified, Execute displays these parameters and prompts you to provide values for them. You can provide values for all parameters in the procedure, or you can choose to provide values for only some of the parameters. If you provide values for only some of the parameters, you must provide values for the other parameters using another method. For example, values are passed from another part of the application. After providing parameter values, you can test the called procedure.
Execute is available from all development areas of the product.
The HtmlForm component enables you to add HTML code to the active procedure. HTML forms are used to display HTML content. You can choose to reference or embed HTML forms in your procedure.
Note: HTML pages created in the HTML canvas are not meant to be used with an -HTMLFORM that uses run-time references. The HTML canvas cannot evaluate -HTMLFORM when run-time references to file names and objects are used.
The Include component allows you to include a whole or partial procedure in another procedure. A partial procedure might contain heading text or syntax that should be included at run time based on a test in the calling procedure. It enables the reuse of code, making applications easier to write and maintain. After an included procedure runs, control returns to the calling procedure.
An Include component can be placed anywhere in a procedure.
The Olap Dimensions component allows you to create a temporary OLAP hierarchy and dimensions to build reports from, without modifying the Master File. Instead, you create a local hierarchy, where the information is stored in the active procedure. After you create the local hierarchy, you can build a report.
The Match component launches the Match Wizard, where you can merge two or more data sources and specify which records to merge and which to sort out. The wizard creates a new data source (a HOLD file) which merges fields from the selected records. You can report from the new data source and use it as you would any other HOLD file. The merge process does not change the original data sources.
You select the records to be merged into the new data source by specifying sort fields in the Match Wizard. You specify one set of sort fields (using the BY phrase) for the first data source, and a second set of sort fields for the second data source. The Match Wizard compares all sort fields that have been specified in common for both data sources, and then merges all records from the first data source whose sort values match those in the second data source into the new HOLD file. You can specify up to 32 sort sets, which includes the number of common sort fields.
In addition to merging data source records that share values, you can merge records based on other relationships. For example, you can merge all records in each data source whose sort values are not matched in the other data source. Yet another type of merge combines all records from the first data source with any matching records from the second data source.
You can merge up to 16 sets of data in one Match request. For example, you can merge different data sources, or data from the same data source.
Note: The limit of 16 applies to the most complex request. Simpler requests may be able to merge more data sources.
The Other component enables you to enter commands that connect other components. This feature is useful for writing code that does not have a graphical tool (such as Dialogue Manager). However, you can also use Other for any kind of manual coding, for example, to code a virtual field or a report. When used this way, the Other component automatically converts to the corresponding component type.
An Other component can be placed anywhere in a procedure.
Dialogue Manager is the part of the WebFOCUS language that controls the execution of your application components. You can add flexibility to your application design by dynamically managing the flow of control in procedures using Dialogue Manager commands and variables whose values are supplied at run time.
You can select five different types of Dialogue Manager components to add to your procedure.
Components can be added to the Procedure View panel in any order. After adding a component you may need to change the order.
The order of components in the Procedure View panel can be significant. For example, suppose you have a report component and a define component, where the define component is a field used in the report. In this case, the define component must appear before (above) the report component in the Procedure View panel. Otherwise, the system will display a message when you try to run the report.
To move a component, click and drag it over another component until the target component is highlighted. As the component is moved, the pointer displays a box image. Release the mouse button and the moved component will appear after the highlighted component.
To copy a component, hold down the Ctrl key, click the component and drag it up or down. As the component is copied, the pointer displays a plus (+) sign. Release the mouse button and Ctrl key and the copied component will appear after the highlighted component.
Note: You can move or copy a component in the Procedure View panel even if the component is open in its respective canvas.
This section describes how to create procedures and procedure components.
Note: If you select Run complete procedure when the procedure is in an invalid state you will get an error message asking if you would like to run the procedure with the last good content.
The Select Data Source dialog box opens.
The Report canvas and the Procedure View Panel open.
Tip: The Field tab appears when you select a data column on the Report canvas.
The Engine canvas opens.
The Welcome to the WebFOCUS SQL Report Wizard window opens.
The Open File dialog box opens.
The Define canvas opens.
The Format dialog box opens.
Select the Override missing values handling check box to specify how null or missing values should be handled. Select the Associate the temporary field with the real field that is selected check box to place the virtual field into the same segment as the selected real field.
The Check dialog box opens displaying the component code and either an error message, or text stating that no error exists.
You can define multiple virtual fields for a procedure. You can view all virtual fields within a Define component in the Defined Fields list.
After you define a virtual field, you can create a report that uses the virtual field. Right-click the Define component, point to New, and click Report.
To create a user define function:
The Welcome to the Define Function Wizard window opens.
The Name dialog box opens.
The Parameters dialog box opens.
You can rename the parameters by double-clicking on the name column. For each parameter, clicking the ellipsis button in the Format column will open the Format dialog box, allowing you to edit the format of that parameter. Double-clicking in the Description column for each parameter will allow you to edit the description for parameter.
The Defined Fields dialog box opens. One defined field (with the same name as your function) is already entered.
Note: A function is comprised of expressions that returns a value to the caller of the function.
You can rename the fields by double-clicking on the name column. For each field, clicking the ellipsis button in the Format column will open the Format dialog box, allowing you to edit the format of that field. Clicking the ellipsis button in the Expression column will open a dialog box where you can edit what the function will do.
Note: The last defined field must have the same name as the function. This is why one defined field is already entered with the same name as the function. If multiple expressions are present, then the defined field with the same name as the function must be in the last position. If no defined field has the same name as the function, or if the defined field is not in the last position, you will be unable to progress to the next window.
The Define Function Wizard Complete window displays. The function, as well as its parameters and logic, are displayed before completion.
This can be done as many times as needed, allowing you to create multiple functions in the procedure, without having to exit and repeat certain steps.
Selecting a Define Function component and clicking Open will open the Define Function Wizard. Here, you can change any part of the already created function by going through each window.
Selecting a Define Function component and clicking Delete will delete the function.
To create a define function library:
The Welcome to the Define Function Wizard window opens.
The Name dialog box opens.
The Parameters dialog box opens.
You can rename the parameters by double-clicking on the name column. For each parameter, clicking the ellipsis button in the Format column will open the Format dialog box, allowing you to edit the format of that parameter. Double-clicking in the Description column for each parameter will allow you to edit the description for parameter.
The Defined Fields dialog box opens. One defined field (with the same name as your function) is already entered.
Note: A function is comprised of expressions that returns a value to the caller of the function.
You can rename the fields by double-clicking on the name column. For each field, clicking the ellipsis button in the Format column will open the Format dialog box, allowing you to edit the format of that field. Clicking the ellipsis button in the Expression column will open a dialog box where you can edit what the function will do.
Note: The last defined field must have the same name as the function. This is why one defined field is already entered with the same name as the function. If multiple expressions are present, then the defined field with the same name as the function must be in the last position. If no defined field has the same name as the function, or if the defined field is not in the last position, you will be unable to progress to the next window.
The Define Function Wizard Complete window displays. The function, as well as its parameters and logic, are displayed before completion.
This can be done as many times as needed, allowing you to create multiple functions in the procedure, without having to exit and repeat certain steps.
Selecting a Define Function component and clicking Delete will delete the function within the Define Function Library.
The Set canvas opens.
The selected parameter is added to the Used Settings list. The available values for that parameter display in the Current Value list.
Note: You can also select a parameter and click the Add button to add it to the Used Settings list.
The Check dialog box opens displaying the component code and either an error message, or text stating that no error exists.
This setting is now on, and will affect the way the procedure works.
The Open File dialog box opens.
The Join canvas opens and displays the fields in the Master File.
You can also right-click the Join canvas and select Add File.
The new Master File is added to the canvas. Common fields in both files are joined by a Join connector line.
A dialog box opens, displaying the component code, and either an error message or text stating that no error exists.
You can add another component to the procedure by right-clicking the Join component, pointing to New, and clicking the component. When you are prompted to select a Master File, select the same host file you used to create the Join component. This allows you to use the joined data sources.
Note: For more information on how to create each type of Join, see Creating Joins Using Join Functionality.
The Use canvas opens.
\\Server1\Disk1\filename.ext
The Universal Naming Convention (UNC) allows you to type the server name without entering the explicit path to the server. However, in order to take advantage of the UNC you must first attach to the server. For information on attaching to a server or mapping network drives, consult your Network Administrator.
Enter the Master File name to be associated with the data source in the MASTER File field.
The Check dialog box opens displaying the component code and either an error message, or text stating that no error exists.
The Welcome to the Allocation Wizard window opens.
The name can be from one to eight characters. If you are identifying a data source, the name must be the same as the name of the Master File.
Note: The options vary depending on which device is selected. The steps below detail how the Allocation Wizard continues with the selected device.
Tip: At any time, you may click Back to go back and change the device, or any of the device settings.
Note: The application folders from the Reporting Server are shown by default and depend on the area from which the Allocation Wizard is invoked. Some examples of the Reporting Server application folders are Data Servers and Workspaces.
or
Click the Browse button to display the Open dialog box and select from the list of existing files.
Note: The default file type is Data Files (*.dat). You may also select Temporary Files (*.ftm), and All Files (*.*), as the type of file.
These additional options are:
Note: The application folders from the Reporting Server are shown by default and depend on the area from which the Allocation Wizard is invoked. Some examples of the Reporting Server application folders are Data Servers and Workspaces. You may specify a file in a directory that is not in the Reporting Server Application Path by using the Advanced option from the completed Allocation.
or
Click the Browse button to display the Open dialog box and select from the list of existing files.
Note: The default file type is Data Files (*.dat). You may also select Temporary Files (*.ftm), and All Files (*.*), as the type of file.
The following syntax is applied to the FILEDEF statement when using a Printer device:
FILEDEF OFFLINE PRINTER BASEAPP/TEMPOFFLINE.FTM (PRINTER \\ibiprint\28C1
In the following example, you will create two procedures: a report procedure and an Execute procedure. The first procedure, named salesrep, will contain a sales report with parameter prompts. The second procedure, called svalues, will contain the values for the parameters in salesrep, and will execute the called procedure, salesrep. The result will be a sales report with parameter values filled in.
The Resolve procedure parameters dialog box opens, as shown in the following image.
The code in the Execute canvas shows the Execute code, with the selected parameter values, as shown in the following image.
The Sales Report displays, as show in the following image.
The Open File dialog box opens.
The Match Wizard opens in a new canvas. It uses typical wizard behavior in which you click a series of Next buttons to navigate from one window to the next. You can also use the Match Preview area to navigate the Match Wizard.
You can add a Match Alias (how the field appears in the HOLD file field list) and a Prefix Operator for each field.
Note: You can remove fields from this list by clicking the Delete button. If you add more than one field, you can also use the Move Up and Move Down buttons to rearrange the orders of the fields.
Note: You must have at least one BY field.
Step 3 of the Match Wizard opens.
The Open File dialog box opens.
Step 4 of the Match Wizard opens.
Step 5 of the Match Wizard opens.
The Match Wizard - Summary window opens, where you can review the final MATCH request.
-HTMLFORM sends report output to the HTML file you create for a webpage, and displays that page in the browser. The output can be saved as an HTML file that can be displayed later.
The syntax is:
-HTMLFORM filename [SAVE AS htmlpage]
or
-HTMLFORM BEGIN . . . -HTMLFORM END
where:
Is the HTML file that contains placeholders for the report or reports that WebFOCUS creates with the command:
ON TABLE HOLD HTMTABLE AS report
Indicates that the HTML page, created when the HTML file filename and the report or reports generated by WebFOCUS are combined, is to be saved.
Is the file name for the HTML page that is created when the HTML file filename and the report or reports generated by WebFOCUS are combined. This file is saved so that it can be displayed later.
Indicates the beginning of an inline HTML form in a procedure.
Indicates the end of an inline HTML form in a procedure.