Creating re-usable components in WebI

When we find ourselves developing a Web Intelligence document with multiple tabs, a common practice is to duplicate the components needed all across the document. For as convenient as this method may appear, it comes with a price: we end up with a vast amount of cells, tables and graphs that are very similar to each other, but that in actuality are very tedious to maintain. In this article the method presented provides a way to create a single table or graph that can be later copied anywhere throughout the document, with the ability to modify its content depending on the component’s location and its name.

Useful formulas

The following formulas may be of interest to you:

=ReportName(): Brings the name of the Report (tab) of the WebI document

=BlockName(): Brings the name of the component (table, graph or cell). It’s interesting to point out that this name is unique in the WebI document.

The solution

  1. The idea is to base the content of the tables and the graphs on variables. The variables, to which we are refering, consist of the “IF-THEN-ELSE” clauses based on the formulas indicated above.
  2. As a next step, we create the table or graph based on these variables.
  3. Last but not the least is to place the component within a report with a specific name and/or name the block accordingly.

Let’s consider the follwing as an example. Our objective is to be able to visualize Sales and Revenue by Customer in a graph and within a report tab which we can name Customer. Then, in addition to this, we also want to be able to visualize Sales and Revenue, this time filtered by Country. As for before we want to display this in a graph and within another report tab which for convenience we can call Country. Below I have provided an exemplification on how to proceed:

1. Creation of variables:

[Dimension] = IF ReportName()=¨Customer¨ Then [Customer] ElseIf ReportName()=¨Country¨ Then [Country]

[Measure 1] = [Sales]

[Measure 2] = [Revenue]

2. Creation of the graph using these variables, but only once.

3. Copy and paste the graph in the Reports Customer and then Country and name them meaningfully (e.g. Graph_Customer and Graph_Country).

If we decide to go the extra mile and, within the Country tab, want to also have displayed an evolution graph of Sales by Salesman, we can achieve this by simply enhancing the variable from above:

[Dimension] = IF ReportName()=¨Customer¨ Then [Customer] ElseIf ReportName()=¨Country¨ And BlockName()=¨Graph_Country¨ Then [Country] ElseIf ReportName()=¨Country¨ And BlockName()=¨Graph_Sales¨ Then [Salesman]

We will then Copy and paste our graph in the Country’s tab and name it Graph_Sales.

In conclusion to this article we notice how this solution simplifies significantly things for a developer or maintainer specialized in WebI reports easing the work load especially when it comes to components that are very complex to configure, like highly formatted graphs.

It is important that you bear in mind that this solution will only work with BOXI 3.1.sp3 or higher versions, so make sure your software is updated.

If you have questions about this handy solution in WebI, or if you want to share your experience or tips, just leave a comment!