Vous êtes sur la page 1sur 11

Business Objects XI 3.

1 Web Intelligence (Tips & Tricks)

-- By Charuta Sathe

While working on Business Objects, there were certain learnings, as well as some tricks used that might be helpful when developing Web Intelligence reports. Few of these are listed below -

Progress Bars in Web Intelligence ..........................................2 Formatting Hyperlinks using JavaScript & HTML .......................3 Working with Merged Dimensions...........................................5 Adding Total rows at the start of Table ...................................6 Working with Optional Prompts .............................................7 Hiding Report Blocks when exported to Excel............................8 Troubleshooting in BO ...................................................... 10 Did you know? ................................................................ 11

Progress Bars in Web Intelligence


Requirement: The report templates in Web Intelligence mainly include charts, tables, cells A Progress Bar is not directly available in WebI reports. Workaround: Although there are no direct components available, it is possible to make a bar chart appear as a progress bar as the one given below

Step 1: Drag a Horizontal Grouped Bar Chart on the report and place the measure object that needs to be plotted. Please note - the chart will not have any dimension objects! Step 2: This chart will not plot any values on the X-Axis. Format the chart height and width as required. In Appearance tab, there is a property Show Floor which needs to be unchecked. By default, this is checked. Step 3: Some more chart properties that need to be set for X-Axis, Y-Axis, scale needs to be specified with the Min and Max value, based on the range (E.g. for Percentages 0 to 100) Step 4: For displaying multiple color codes on the progress bar, based on the progress attained, multiple components needs to be used, and shown conditionally. The final output looks like this

Formatting Hyperlinks using JavaScript & HTML


Requirement: Hyperlinks are used for report navigation, from a main summary report to a detailed one. An appropriate link color is shown for Hyperlinks on numeric values that are based on some number format. Example, the negative numbers are shown in RED, enclosed in brackets, so the hyperlink format has to be set accordingly. In case of nulls, 0 is shown on the report, and for hyperlinks, it displays an alert message that indicates there is no data available to view in the detailed report. This differentiates zeros from nulls. Workaround: Formatting hyperlinks is done using HTML and JavaScript. Basic code used for creating hyperlinks in BO is through opendocument parameters: "<a href=\"../../../OpenDocument/opendoc/openDocument.jsp? iDocID=AeL8bR6uhQBOmA7PKLVB8kg&sIDType=CUID&sType=wid&sOutputFormat=H&sRefresh=Y &sWindow=New....................... "\" title=\"\ "</a>" Note: In the above tag, ../../../ represents the relative path, this is used so that there is no code change, when report is migrated from one environment to another. Step 1: Default color for hyperlink is Blue. This is changed using HTML. a style='color:red;' The above HTML code is appended in the opendoc url. "<a style='color:red;' a href=\"../../../OpenDocument/opendoc/openDocument.jsp?......................."</a>" In addition to this, the variable needs to be formatted FormatNumber([Metrics];"#,##0;(#,##0);0")to show numbers in brackets. Note that, this change is seen only while viewing a report. When the report is opened in Edit/Modify mode, the hyperlink still appears in Blue. In the below figure, there are hyperlinks on revenue numbers as well as on the Months displayed.

On clicking the hyperlink on revenue figures, it would conditionally call the detailed report or would give a message in case there is no data available.

Step 2: For displaying an alert message, JavaScript function is used. <SCRIPT LANGUAGE="JavaScript"> function MsgBox () { alert ("No Data to retrieve for Current Selection") } </SCRIPT> The above code can be placed in a blank cell, anywhere on the report. In the properties tab for the Blank cell, Read cell contents is changed to HTML MsgBox () function is invoked in the hyperlink code. The alert message is a meaningful one, instead of opening a blank report.

Working with Merged Dimensions


Requirement: Merged dimensions are useful when there are multiple data providers and have report filters so that the users can filter down on the data.

Based on the selection, the values are displayed on the report header. Cascading is required on the drill filters, example, on selecting a Division EAST, Area filter should show the areas for EAST division. This is achieved by setting the hierarchies on the universes. Issue with Merged Dimensions: 1. Cascading doesnt work with merged dimensions, as the hierarchies are set on the original query objects, not on the merged ones. 2. In some cases, the values shown on the filter are not in sync with the data shown on the report. This was because report had report filters with merged dimensions as well as direct objects from the Main query. For Example, Sales Region object comes directly from a Main query (query 1), whereas Sales Rep is a merged dimension (from query1 & query 2). For Region - 1, there are 3 representatives in the filter, but the report displays more data for representatives coming from both the queries. Workaround: The workaround followed is to use the direct objects from the Main query (Query 1) in the report filter, and display the merged dimensions on the report header as well as on the report. This sounds strange at first, but as hierarchy is set on universe objects, it works perfectly! All the objects required as report filters has to be included in all the queries, to sync up the data shown on the report.

Adding Total rows at the start of Table


Requirement: In tables, total rows can be easily shown in the footer, at the end. What if the total block is to be added at the beginning of the table? Easiest way could be adding it in table header However, the block must not be repeated, and table headers are repeated on the next page.

Workaround: The solution is using Breaks! This is achieved by adding the total rows as Break headers. Step 1: Add an extra row/column; place a dummy variable in it. Step 2: Apply break on it, and format it such that it does not appear as a part of the table. Step 3: In Break properties >> Uncheck Break Footer (by default it is checked) & Show Break Header Step 4: Breaks >> Page Layout >> Repeat header on every page This is to be unchecked. Step 5: Add required number of rows in the break header and format it accordingly.

Working with Optional Prompts


Requirement: There is a hyperlink All Details on Report 1 (Parent report) to navigate to Report 2 (Child Report). All the prompts present on parent and child report are optional.

Issue with optional prompts while report navigation: Ideally, there is no need to pass any prompt parameters when navigating from Parent report as none of the prompts in the child report is mandatory. Yet however, every time when child report is called via hyperlink, it opens the prompt window, and a value has to be selected. This looks to be one of the weird behaviors of Web IntelligenceThe optional prompts need not always be optional! Workaround: When a value is selected, that parameter value is passed, when nothing is selected, yet some value has to be passed as a prompt parameter. This is achieved using Pattern Matching where, * implies ALL Hyperlink Code: "<a href=\"../../../OpenDocument/opendoc/openDocument.jsp?iDocID= +"&lsSSales+Region="+URLEncode(If(UserResponse("Sales Region")<>"";""+UserResponse("Sales Region");""+"*"))+"\" title=\"\">All Rep Details</a>" The prompt in the child report are set as given below -

Hiding Report Blocks when exported to Excel


Requirement: Example Consider a report with charts and tables When there is no data available to display on charts, an appropriate message such as no data found can be displayed on the report. This is done by formatting a vertical block and aligning it with the chart. No Data found block is overlapped with the chart and conditionally hidden/shown on the report. Issue with Excel Output: Web Intelligence reports can be exported to excel. In such cases, all the visible blocks used on the report are shown on the excel sheet and entire alignment of the charts and tables gets distorted. Excel Output without hiding any blocks Excel Output on conditionally hiding blocks

Workaround: There is no direct way of hiding the blocks when a report is saved to excel. This is done with conditional formatting. Step 1: Take the count for the dimension object that is used in the chart and place it in the No data found block. (This is referred to as NDF block in the below steps)

Example, a chart plots Region-wise monthly revenue. Count ([Region]) would always be greater than zero. Yet, there might be scenarios when there is no data for a particular selection. i.e. Count = 0 Step 2: Apply filter Count ([Region]) EQUAL to 0 on the NDF block. This block would appear only when there is no region i.e. when the chart is blank Step 3: The message No data found for Current Selection is displayed using alerter, when count is zero. Now, when the report is saved as excel, the NDF block is not visible! Similar steps can be used for formatting vertical tables.

Troubleshooting in BO
#TOREFRESH #TOREFRESH appears in Web Intelligence reports based on smart measures. I.e. when the measure used in the query has a projection function set to Database Delegated. The reports used SAP BW query as backend, where the projection function for a measure is set to Database Delegated by default.

The results are displayed on refreshing the document. #UNAVAILABLE #UNAVAILABLE appears when Web Intelligence cannot calculate the value of a smart measure. If a filter is applied to a dimension on which the value of a smart value depends, but the dimension does not appear explicitly in the calculation context of the measure, Web Intelligence cannot return a value for the smart measure and displays #UNAVAILABLE.

# FORMAT This appears when the format of the cell contents do not match with the format specified in the code.

CY Metric contains revenue numbers, and is given a format which was not identifiable. Example, ' FormatNumber ([CY Metrics];"Mmm-yyyy") CY Metrics has the data type number, whereas the format specified is for Date object.

10

Did you know?


Working on Web Intelligence Reports XI 3.1
Hide the report filter toolbar, and display it again, the filters are gone When key figures are not included into the query panel for Web Intelligence reports, which are created on the universe based on BEX Queries, it results into Cartesian product and gives erroneous / incorrect records. It is always recommended to include atleast one key figure while running WebI report based on SAP BW queries. Projection function for a measure is set to Database Delegated by default when SAP BW queries are used in backend. Cascading effect on Drill filters does not work with Use Query Drill option in the Report Document Properties. This option needs to be unchecked. Working with Web Intelligence report using report filters, disables undo/redo options. Best way is adding report filters at the end! Table blocks cannot be directly placed in a report header/footer. Try dragging it! You wont be allowed to add a table in the header/footer. This can be done by placing the block in the report and then dragging it on the header or footer. Alerter on charts goes off, with any small change in the report Example, report is switched to structure mode, and the chart alerter is gone. This was observed in Service Pack 2, it is resolved in SP3 version. Did you know - Removing a Section will remove all the blank cells used in the report Try doing it! Best practice would be using a variable as a section, instead of adding a direct object.

11

Vous aimerez peut-être aussi