COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Business Insight Advanced / Cognos Workspace Advanced => Topic started by: tjohnson3050 on 18 Apr 2013 11:21:38 AM

Title: Row Numbers in List Reports in BIA
Post by: tjohnson3050 on 18 Apr 2013 11:21:38 AM
Background:

Query Studio has an easy feature to add row numbers to list reports.  This feature is not available in Business Insight Advanced.

Since BIA uses the same report definition as Report Studio, we can take advantage of the clipboard fragment feature to overcome some of the limitations of BIA.

Work Around:

Assuming you start with a list report you have created in BIA, you can add row numbers by copying and pasting the following code fragment:

<RSClipboardFragment version="2.0"><listColumn><listColumnBody><style><defaultStyles><defaultStyle refStyle="lc"/></defaultStyles><CSS value="text-align:right;;white-space:nowrap"/></style><XMLAttributes><XMLAttribute name="qsc" value="lc" output="HTML"/><XMLAttribute name="tag" value="C1"/></XMLAttributes><contents><textItem><dataSource><reportExpression>RowNumber()</reportExpression></dataSource></textItem></contents></listColumnBody><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><XMLAttributes><XMLAttribute name="qsc" value="lt" output="HTML"/><XMLAttribute name="tag" value="C1"/></XMLAttributes><contents><textItem><dataSource><staticValue>Row</staticValue></dataSource></textItem></contents></listColumnTitle></listColumn></RSClipboardFragment>

1.   Select the text in bold above and copy (to windows clipboard)


2.   From BIA, switch to Page Design view, select the the first column header in the list report and choose Edit – Paste To – then Insert Before and click ok.
Title: Re: Row Numbers in List Reports in BIA
Post by: Lynn on 29 Apr 2013 01:45:11 PM
Great tip!! Thanks for sharing!!
Title: Re: Row Numbers in List Reports in BIA
Post by: pumccg on 30 Apr 2013 04:54:10 AM
You can also add a query calculation to your list report and use the running-count() function. This function doesn't appear in the list of available functions but if you type it into your query calculation and use it to get a running count of one of the data items in your list report it will give you row numbers.

NB: in BIA/CWA Cognos don't make too many of the usual Report Studio functions available, but it you type them into a query calculation they may work!