In this section: |
How to: |
Drilldowns are a powerful feature that allows users to navigate from one content item to another, providing access to additional, related information at run-time. Drill-down links can also be used to pass parameters, so that the target content is automatically filtered for the value that a user selects, allowing you to maintain context between items. By linking content with drilldowns, you can vastly expand the amount of information that is available from a single chart or report.
In a report, drill-down links are provided as hyperlinked values. In a chart, drill-down links are executed when you click a section of the chart. When you add multiple drill-down links to a single field, you can select one from the tooltip menu that results when you click a report hyperlink or point to an area of a chart.
You can create different types of drill-down links to connect to different types of target items. You can use the link to open a selected content item or page, connect to a URL, or execute a JavaScript function .
To create drill-down links for a field, right-click a field in any bucket of a report, or in the default measure bucket of most chart types, and click Configure drill downs. The Configure Drill Downs dialog box opens, as shown in the following image.
To create a drilldown, click the plus icon. Next, determine the type of content that you want to link to. The information that you provide to create the drilldown differs depending on the target type.
Select Content/Page to link to another procedure, such as a chart or report, or to a page. Select the item from your WebFOCUS repository, and choose where it should load. You can load the target content in a new window or browser tab, the same window as the current item, or you can specify a window or frame by name.
Note: Drill-down links are functional at design time. When the drill-down target location is Current Window, clicking a drill-down link in the canvas opens the target in a new browser tab or window so that WebFOCUS Designer can stay open. When you run your content, drilldowns with a target location of Current Window load in the window where the drilldown was accessed.
You can also configure the drilldown to pass parameter values to the target item. If the target uses dynamic parameters, such as prompted filters, matching parameters with the same name are automatically created to pass the value that a user clicks. The selected value will be applied to the target content when it loads.
To manually add parameters to pass through the drilldown, click the plus sign in the Parameters section of the Configure Drill Downs dialog box. First, provide a parameter name, which should match the names of amper variables in the target content. Using the menu in the Type column, set whether the parameter should pass field values, a static value that you set, or the value set for a global variable in your environment. Finally, select a field, enter a value, or select a global variable to pass. You can automatically create all parameters in the target content by clicking Add all target filters, or create parameters for all sort fields in your parent content – that is, the chart or report that you are currently editing – by clicking Add all group fields. You can then delete individual parameters if you want, or delete all parameters by clicking Clear List. Drill-down parameter options are shown in the following image.
To link to a web page through a URL, select the URL radio button. The URL must include the protocol, for example, http or https, if it is an external link. Otherwise, the URL will be interpreted as a partial URL within your WebFOCUS environment.
Next choose where the target URL should load, whether in a new window, the same window, or elsewhere. Finally, add any parameters. If you add parameters, they are appended sequentially to the end of the URL as key-value pairs using a GET request in the following format:
?parameter_name1=value1[¶meter_name2=value2 ... ¶meter_namen=valuen]
where:
Are parameter name values, specified in the Parameter Name column of the Configure Drill Downs dialog box.
Are parameter values. They can be field values passed from the report, or static values. The field or static value is specified in the Field/Value column of the Configure Drill Downs dialog box.
The question mark (?), ampersands (&), and equals signs (=) are added to the URL automatically, so you do not need to include them when setting up the drilldown.
To execute a JavaScript function from the drill-down link, select the JavaScript radio button. In the JavaScript Function text box, supply the name of the JavaScript function. The function and the arguments that it accepts must already be defined for the function to work. You can define custom JavaScript functions in a .js file on your environment, which you can create using the text editor or upload from your machine, then reference that file using the SET JSURLS command. This command can be applied globally by adding it to edasprof.prf on the WebFOCUS Reporting Server, so the functions in the file are always available to whoever has access. Alternatively, you can add the SET JSURLS command to the Preprocessing Other component of a Reporting Object, then use it as the data source for your content.
In the Request Parameters area, add each argument, in order, as a separate row. These arguments can be static values, by setting the Type column to Value, or dynamic field values, by setting the Type column to Field. Once the type is set, enter the value or select the field whose value should be used as the argument.
You can manage your drilldowns from the pane at the left side of the Configure Drill Downs dialog box. You can create multiple drilldowns that you can access from the same hyperlink in a report or the same area of a chart. To create more drill-down links that you can select from the same location, click the plus sign above the list of drilldowns in the Configure Drill Downs dialog box, as shown in the following image.
When you click a link in a report or an area of a chart that includes multiple drilldowns, a menu appears, listing them all.
Note: The menu for multiple drilldown links on a single field does not display if a report is created as part of a page. They display properly for charts, stand-alone reports, and reports added to a page as external content.
To rename a drilldown link, double-click the title in the drilldown list, and type a new title. These titles appear in the tooltip in your content when selecting a drilldown to execute. Drag a drilldown using the handles to the left of the drill-down title to change the order in which your drilldowns appear.
If you want to remove a drilldown, click the X next to its name. To remove all drilldowns, click Remove All Drill Items .
You can drill down from a chart or report to a page created in WebFOCUS Designer. Drill-down parameters can be passed to the page to apply their values to any page filters.
The filters in this page will be populated with values passed from a drill-down report.
For information on creating a page, see Creating Pages.
On the WebFOCUS Hub or the WebFOCUS Home Page, click Visualize Data.
WebFOCUS Designer opens.
The WebFOCUS Designer canvas appears.
If you are passing multiple parameter values through the drilldown, selecting a field in the chart or report with additional sort values under it may help clarify to the user which values will be passed.
For example, in the report shown in the following image, the Sale Year field is the secondary sort field while Customer Business Region is the primary sort field, so each row in the Sale Year column represents a sale year and a business region.
In this case, adding the drill-down links to the Sale Year column would allow you to choose from all of the available Customer Business Region and Sale Year values, whereas adding the links to the Customer Business Region column would only allow you to pass parameter values for the first sale year in each business region group. As an alternative to creating drilldowns on the lower level sort field, you could ensure that all parameter values are passed from a report by using repeating sort values. On the Content picker, select the Grid report layout option.
The Configure Drill Downs dialog box opens.
The Content/Page drilldown type, which we are using to drill to a page, is selected by default.
Notice that the Parameters grid is automatically filled based on the filters in the selected page.
In a report, drill-down links are added for each value of the field where the drilldown was created. In a chart, drilldowns are added to each section.
A global variable is a variable that maintains its value for the duration of a WebFOCUS session or until a different value is assigned. Global variables are identified by double ampersands. As opposed to local amper variables, which you can pass different values through a drilldown to filter target content based on the value that you select, the best use for global variables is to maintain a single consistent value as you run different content items. In this example, we will set a global variable to the current date, allowing us to filter target content for that date value by invoking the global variable.
The advantage of using a global variable is that its value is not contingent on the content item that is passing it. A local variable, when passed through a drilldown, must be set in the parent procedure, so a field must be added that contains values that the local variables can pass. This is not the case for a global variable, which is set externally to the procedure. However, since the global variable is not set by the procedure that passes it, the drill-down value that you select will not affect the value that is passed, unless the global variable is set to be dependent on a local variable.
The drill-down parameter options in WebFOCUS Designer provide a list of global variables that are already defined in your environment, so the first step is to set the global variable value. Next, you can create target content filtered by a field that can accept that value, and finally you can create the drill-down content that will pass the global variable to the target.
The New Text Resource dialog box opens.
This procedure will set a value for a new global variable.
-SET &&CURRDATE = &YYMD; -TYPE &&CURRDATE
The first line sets the value of a new global variable, &&CURRDATE, to today's date, represented by &YYMD. &YYMD is a system variable that always returns the current date in a YYMD (year-month-day) format. You can change CURRDATE to whatever you want, since it is just the name of the global variable that you are creating.
The second line displays the value of the global variable, &&CURRDATE in this example, as text in the output using the -TYPE command, so you can make sure that it has been set properly.
Click Preview on the text editor toolbar. A new window opens with a message showing the result of the executed procedure. There is no actual output, but it should show the current date in YYMD format under the Detail area.
The global variable is now set for the duration of the WebFOCUS session. To ensure that the variable is always set when a user signs in, an administrator can set this procedure to run automatically using a setting in the WebFOCUS Administration Console. To configure this setting, complete the following steps:
The WebFOCUS Administration Console opens.
When a message appears indicating that the new setting has been saved successfully, click OK and close the Administration Console.
In this case, since the global variable that we have created is set to a date value, we will want to create target content that is filtered by a date field.
Create a new chart or report.
WebFOCUS Designer opens, and you are prompted to select a data source.
The WebFOCUS Designer canvas displays.
The date control in WebFOCUS Designer provides a date range, so when we pass the global variable to the filter parameter, we will pass it as both the start and end date to filter our content to show data for just the current date.
When you are finished creating the target content, click Save.
On the WebFOCUS Hub, click the plus menu and then click Create Visualizations, or, on the WebFOCUS Home Page, click Visualize Data.
The Configure Drill Downs dialog box opens.
The Content/Page drilldown type, which we are using to drill to the target content item, is selected by default.
Notice that the Parameters grid is automatically filled based on the filters in the selected page.
For both of these parameters, complete the following steps:
A drop-down menu appears in the Field/Value column.
When you pass parameters using a URL drilldown, they are sent using GET requests. You can use this functionality to access different web pages based on the value that you select from your content.
In this example, we will use a URL drilldown to open a Wikipedia article for the country that we select.
The Configure Drill Downs dialog box opens.
A question mark, followed by the parameter name and value, will be appended to this URL.
You can trigger a JavaScript function when using a drilldown in your content. The parameters defined when setting up the drilldown are used as the arguments in the JavaScript function. This simple example uses the alert function, which requires no special setup or configuration, to display the dimension field value that a user clicks.
The Configure Drill Downs dialog box opens.
Your content runs in a new browser tab or window.
With some additional configuration, you can execute a custom JavaScript function from a drilldown link. This provides significant flexibility in defining what occurs when a drill-down link is clicked. In this example, we have created a JavaScript function that opens a mailto URL, dynamically populated with an email address and first name from our data source. The first name will be added to the subject line of the email. Since the email address in a mailto URL is not supplied as a key-value pair, we cannot do this using a URL drilldown.
The text editor opens.
In this example, the function to generate a mailto URL is called fnMail, and is coded as follows:
function fnMail(Email,Name) { window.location = 'mailto:' + Email + '?Subject=Hello, ' + Name; }
The two parameters that we will need to supply from the drilldown will be the email address, for the Email argument, and the first name, for the Name argument.
In this example, we are using the wf_retail_lite.mas Master File, part of a sample dataset that can be added to your TIBCO WebFOCUS environment.
If you are using the wf_retail_lite Master File as your data source, in the Dimensions area, expand Customer and then Full,Name, then double-click Email,Address and First,Name.
The Configure Drill Downs dialog box opens.
Note: As an alternative, you can add the SET JSURLS command to the Preprocessing Other component of a Reporting Object, then use it as the data source for your content.
On the WebFOCUS Hub, click Management Center and then click Server Workspaces.
Or, on the WebFOCUS Home Page, open the plus menu and click Prepare and Manage Data.
In the WebFOCUS Reporting Server browser interface, open the Tools menu and click Workspace.
The Server Workspace view opens.
The run-time URL uses the following format:
http[s]://hostname:port/context_root/run/path_to_item
where:
Is the name of the system where WebFOCUS is installed.
Is the port number used by WebFOCUS.
Is the context root used for your WebFOCUS application. For example, ibi_apps.
Is the IBFS path of the JavaScript file in your WebFOCUS repository. You can find the path of a page by right-clicking it on the WebFOCUS Home Page and clicking Properties. The file path is listed as the Path property.
Slashes (/) between folder names should be retained literally instead of encoded in the URL, and the colon (:) should be removed after IBFS. For example:
http://localhost:8080/ibi_apps/run/IBFS/WFC/Repository/My_Workspace/~user/custom.js
The full SET JSURL command may resemble the following:
SET JSURLS='http://localhost:8080/ibi_apps/run/IBFS/WFC/Repository/My_Workspace/~user/custom.js';
A new email opens with the To address and Subject line already filled, with different values depending on the link that you click.
How to: |
You can use a specific, pre-configured JavaScript function called portalDispatch to drill to a target chart or report, and run it an a specified target container on a page. This target container can be identified by a CSS class, which you can set using the Classes property for the content area within a container. The target container can be a basic panel container with a single content item, or a multi-content container, such as a tab, accordion, or carousel container, that contains multiple items. If the content area that contains the target item is part of a multi-content container, then it becomes visible immediately when the drilldown is executed. For more information on setting and using CSS classes, see Styling Pages With Custom CSS. The target chart or report, which you evoke to run in the target container, is referenced using the IBFS path, which you can find in the Path field when viewing the properties of an item on the Hub or Home Page. You can pass multiple items to multiple containers listed in sequence, and you can also pass the values of multiple fields from a single drill-down link to multiple parameters in the target item or items.
You can create the drill-down content and your page in three general steps. First, create one or more target charts or reports that you want to run when a drill-down link is clicked. You can add dynamic parameter filters to these items so that they are filtered based on the selected drill-down link. Next, create a chart or report with a drilldown that executes a JavaScript function called portalDispatch. The function arguments determine what items are run, and where they should run. Finally, assemble a page that contains the drill-down content and containers in which the target content can run. You must also ensure that the portalDispatch JavaScript function is recognized, by specifying the location of the .js file that contains it on the WebFOCUS Reporting Server.
First, create one or more target charts or reports using WebFOCUS Designer.
In order to receive parameter values from your drilldown, the target content must have single select filters. Filters created in InfoAssist are single select by default, while those created in WebFOCUS Designer are multi-select by default, meaning that you must set them to accept a single filter value for them to accept passed parameter values.
WebFOCUS Designer opens, where you are prompted to select a data source.
Drag a field from the Data pane to the Filter toolbar. Optionally, select default values for your filters.
Repeat these steps to allow the target content to accept multiple parameters from a drill-down link.
Create the chart or report that will contain the drill-down links that run the target item or items that you created in the previous set of steps.
WebFOCUS Designer opens, prompting you to select a data source.
The dimension fields that are used as dynamic parameter filters in the target content should be used as sort fields in the parent content.
The Configure Drill Downs dialog box opens.
Note: If the filter in the item that is the target of your drilldown is multi-select, use multiselect_portalDispatch instead of portalDispatch. Parameter values are passed differently to multi-select and single-select filters, so you must use the drill-down JavaScript function that is compatible with the type of filter that you are using.
Specify the following parameter values in the JavaScript drilldown:
For example, if you type panel1 in the Field/Value column when configuring the drill-down parameters, you will need to add panel1 to the Classes property of the content area of the container in the page where the drill-down content will run.
You can run multiple content items to multiple containers from the same drill-down link, in which case the class names should be separated by spaces. For example, panel1 panel2.
If you want to pass the same drill-down parameters to all panels on the page, use the _ALL argument and skip the next sub-step.
To find the IBFS path of an item, right-click it on the Hub or Home Page and click Properties. The IBFS path of the item is listed in the Path field. You can copy it to paste into the Field/Value column when configuring the parameter for the target content.
If you want to run multiple content items, separate them with spaces. The order of the paths should be coordinated with the order of the container classes specified in step 8c. The first listed target item runs in the container with the first specified class, the second listed item runs in the container with the second specified class, and so on.
This value is not necessary if the procedure that you want to refresh is present on the page in the container content area with the class specified in step 8c. If this is the case, you may omit this argument of the drilldown and proceed to step 8e.
Your content now executes the portalDispatch JavaScript function when you click a value that includes drilldowns.
Next, create a page with containers where the target content will be run.
Create a page to which you will add the content containing the drill-down links that you just created, and enough additional panels to run the content items that you set to run when a drilldown is executed. These panels will be identified by the classes set in step 8c of the previous procedure.
Before executing the drilldowns, you must also specify the path to the file containing the JavaScript function in the edasprof.prf server profile.
The WebFOCUS Designer canvas opens.
The item with the drilldowns displays on the page. Resize it as needed.
If the content area that you select is part of a tab, accordion, or carousel container, when you execute the drilldown, the container immediately updates to display the target item. Alternatively, if you do not want to change the displayed items, you can use the self | _NO_FOCUS as the second argument.
Repeat this step for any additional containers in which you want to run other content items, specified in step 8d of How to Create Content with JavaScript Drill-Down Links, using the class names defined in step 8c of that procedure.
Note: As an alternative, you can add the SET JSURLS command to the Preprocessing Other component of a Reporting Object, then use it as the data source for your content.
Or, on the WebFOCUS Home Page, open the plus menu and click Prepare and Manage Data.
In the WebFOCUS Reporting Server browser interface, open the Tools menu and click Workspace.
The Server Workspace view opens.
The partial URL points to the location in your WebFOCUS installation where the portalDispatch JavaScript function is defined. Note that if the context root of your installation is not ibi_apps, you must replace this part of the path with the custom context root that you are using.
The page runs in a new browser tab. Click a drill-down link in the parent item created in How to Create Content with JavaScript Drill-Down Links. One or more target items, created in How to Create the Drill-Down Target Content, run in another container on the page. These items are also filtered based on the value that you clicked, since you specified the parameter name and field when setting up the JavaScript function.