If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Displaying Row Count of the Entire Report

Started by mhauser, 18 Feb 2009 10:20:15 AM

Previous topic - Next topic

mhauser

I have a list report on the web where I would like to display the row count of the entire report in the header. I would like the report header to say something like this:

This report has 1200 rows

How can I get that "1200" to appear in the header?

wyconian

Hi

This isn't that easy because if you run the report in html (on the web) cognos only renders one page at a time.

I think what you need to do is have a second query that counts the number of items in your main query e.g. if the main query shows sales for accounts the second query should be just a count of the number of accounts based on the same selection criteria as the main report.

You can then add the second report into the header.

Good luck

mhauser

Thank you for the quick response.

I tried adding another query using the same filter parameters as the main query used for the report's results. The new query contains only one data item... count([MYDATA].[SERIALNUMBER])

When I run the report, I get the following error: CRX-API-0005 An error on or around the position '0'. The variable named '[MYDATA].[SERIALNUMBER]' is invalid. I have tried to delete the new query just to get back to the original report, and this error remains.

I am not sure what I am doing wrong.

mhauser

Okay, I found the problem. Your advice worked great but I was not aware of what was needed to make the RowCount display properly.

First, I created a new Query that does a row count as you suggested. Then, I added that row count as a data item to the original query. Then, I needed to go to the Properties window for these two queries and edit the "Cross Product Allowed" value so that it is set to "Allow". Otherwise, you will get a big long error.

Then, add another text item to the header. In the Properties window, change the "Source Type" to "Data Item Value". Select the new data item name from the list.

After all that, you can get a Row Count to appear.


Rajaggopal

Why did u have to go for another separate query to do this? You could have had a data item with 1 in expression and performed a total([DATA ITEM]) and added that data item to the report header. But before doing that u need to associate the query to the page and then display that data item.