-
Book Overview & Buying
-
Table Of Contents
IBM Cognos 8 Report Studio Cookbook
By :
A report shows Unit cost and Unit price of all products. It also works out the Profit Margin from these two.
Business owners are naturally more interested in products with a high profit margin as well as a high unit price.
In this recipe, we will create 'Variable width bar chart' using JavaScript, which shows a bar for every product. The length of bar will indicate the Profit Margin, whereas width will indicate the unit price.
Create a simple list report with Product name, Unit cost, and Unit price as columns.
Also add a calculated item, called Margin, to the list to compute the Profit Margin and define it as: ([Unit price]-[Unit cost])/[Unit cost].
Drag a new HTML item on the list report as a new column.
. Add four more HTML items in the column where you added above HTML item. The report should look like this in the Studio:

Now define the first HTML item as:
<script>var...
Change the font size
Change margin width
Change background colour