COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Report Studio => Topic started by: mohammed25 on 23 Jan 2007 05:02:23 AM

Title: Displaying report, even with no data
Post by: mohammed25 on 23 Jan 2007 05:02:23 AM
Hi Report Gurus,

I burst reports to 99 branches for my organization, and some branches does not hold data for a particular day but they would still like to see the actual report with blank columns as they use it for audit purposes.
Can u please help me out in displaying all branches even with no data the report has page breaks on branch and needs to show all the columns even if there is no data for the branch. I was able to acheive it through master-detail query but was still wondering if there is any other way.
plz help
any help is appreciated.
Title: Re: Displaying report, even with no data
Post by: mavarga on 24 Jan 2007 08:24:21 AM
I am not sure which version you use for reporting but in documentation for cogos 8 "cognos 8 report studio users guide"  is example on  page 124.
I have tried but i was not sucessfull to repeate example.


Marek
Title: Re: Displaying report, even with no data
Post by: MDXpressor on 24 Jan 2007 07:32:16 PM
There is a technique available in the Report Authoring Part 2 Public Course whereby they perform a count of rows for the report on the list and attach a rendering variable to it which will conditionally render either a) a list of data if the RowCount>0 or b) Text Item: "No Results" if the RowCount =0.  Do you need a sample?
Title: Re: Displaying report, even with no data
Post by: mohammed25 on 31 Jan 2007 03:53:42 AM
Hi MDXpressor,

Thanks for the reply. It would be great if you could either guide me to the tutorials if they are on COGNOS website or post the sample example here.
Thanks again for your help.
Title: Re: Displaying report, even with no data
Post by: COGNOiSe administrator on 09 Apr 2007 02:45:14 PM
It would be great you you were to post an example based on GO Sales and Retailers package.
Title: Re: Displaying report, even with no data
Post by: Gloves on 09 Apr 2007 05:40:17 PM
You could use a Union in a Tabular Set.  This has helped me many times.  Make sure you have the same data items in both qrys.  You can use 0 in the items that have no data.
Title: Re: Displaying report, even with no data
Post by: COGNOiSe administrator on 09 Apr 2007 06:47:44 PM
How would a UNION help in this case? We are trying to display a text if there is no data returned from a query.
Title: Re: Displaying report, even with no data
Post by: COGNOiSe administrator on 09 Apr 2007 08:50:22 PM
BTW, none of the Cognos samples mentioned on the support site work, or they don't work with multi list reports.
Title: Re: Displaying report, even with no data
Post by: MDXpressor on 10 Apr 2007 03:22:02 PM
Apologies for the delay in providing this example.  Year-end pretty well sucked up all of my cycles for the past month or so.  I promise I will provide a sample in the near future...
Title: Re: Displaying report, even with no data
Post by: COGNOiSe administrator on 10 Apr 2007 04:00:37 PM
Don't worry about it. I should have one ready today or tomorrow. The trick was to use Conditional Blocks inside a list. Pretty cool if I say so myself. Let me generalize it with GOSAR.
Title: Re: Displaying report, even with no data
Post by: Moody on 30 Apr 2007 01:42:05 PM
Quote from: COGNOiSe administrator on 09 Apr 2007 06:47:44 PM
How would a UNION help in this case? We are trying to display a text if there is no data returned from a query.

I've done this before... I had to use a "generic" table that I created (with basically records that had a value of 0 for the column). I was then able to use this table to create my "empty" tabular model, which was then merged (through a set) with the "real" tabular model. Decent approach for a tabular model solution (vs. using Conditional Formatting)
Title: Re: Displaying report, even with no data
Post by: COGNOiSe administrator on 01 May 2007 06:46:30 AM
My approach was to use the base Tabular Model as  Tabular Reference for a "counting tabular model". Then based on the results of the counting query I was able to establish a conditional variable which in turn controlled a conditional display block.
Title: Re: Displaying report, even with no data
Post by: Maple on 15 May 2007 02:22:31 PM
Hey mohammed,

You can show blank col in your report by using Dimension Info option cognos 8.1...

step 1: Open the report in Report Studio
step 2: Navigate to the query that is feeding the crosstab via the Query Explorer
step 3: In the properties pane for the query, change the "Override dimension info" property to "Yes" from "No"
step 4: At the bottom of the screen, there will now be a "Dimension Info" tab
step 5: Add the items for the rows to one dimension by dragging them from the insertable objects pane to the dimension column.
step 5: Add the items for  the columns to the white space in the dimension column to create another dimension.
(e.g: Date,Location and Products)

2nd option : Union(as you know that you don't have data for some branches... so you have to fake it by using 0 in your query)
use union as Gloves said...create 2 quries having same data items
step 1: Query1> original query
step 2: Query2> copy of query1....use every thing same except measure...instead of using measure use 0
when  you union these 2 queries then it will give you the same result that you were getting before except it will show 0 values for those branches which are not holding any data...
and then you can format the coulmns >RMC (on the column) > Dataformat > select format type > "Zero value charachter"> you can use - or etc



Title: Re: Displaying report, even with no data
Post by: COGNOiSe administrator on 17 May 2007 02:54:36 AM
Good tip, but the post was about Cognos ReportNet, not Cognos 8.1.
Title: Re: Displaying report, even with no data
Post by: Maple on 17 May 2007 01:18:41 PM
try this tech it will work