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

How do I force blank lines into a Cognos Report studio list report?

Started by jmsellner, 11 Apr 2012 08:59:19 AM

Previous topic - Next topic

jmsellner

We have a requirement that one of our Cognos report lists always have 9 lines even thou the data grouping has less than 9 lines.

If the data grouping has 4 lines they would like us to include 5 blank lines.  If the next data grouping has 9 line, I wouldn't include any blank lines.

I found a proven practice that might work if I was using a crosstab, but the current report is a list report and it wouldn't make sense to be a crosstab.

I know if the data isn't available that Cognos can't list it.

Any ides's on how I might force the variable blank lines the user wants.

Lynn

The odd requirements that people turn up with never cease to surprise me :)

My first thought is to create 8 group footers and then conditionally show or hide each one based on how many group items were returned in your query. You would need a query calculation that computes the number of groups in the result set.

Let's call your query item [GroupCount] and it should return a number between 1 and 9 using an expression something like:
count([YourGroupItem] for report)

Your layout would look like this:

List
Blank2
Blank3
Blank4
...
Blank9

Each of the 8 group footers would get it's own advanced conditional style. For Blank2 specify an advanced conditional style of:
[GroupCount] >=2
Then specify box type none for this condition. This means that the row is only displayed if the group count is 1.

For Blank3 specify >=3 for the condition so it will only render when the group count is 1 or 2.

Repeat this for the remaining footer rows.

Another approach might be to create a union query that combines your result set with up to 8 additional dummy rows that you could similarly display or hide conditionally.

abhijeet364

Hi Lynn,

Can you please explain briefly the second approach that you have suggested in the attached link.

Thanks & Regards
Abhijeet

Lynn

You mean a union approach? The idea was to create a dummy query that would always return the proper number of rows so that when unioned with the real query you'd end up with a complete set per the requirements. In the example below, say you need 4 rows no matter what....the dummy query would be created to ensure you always get 4 so that even if your real query returned fewer than 4 the final set would have everything. Something akin to an outer join.

If the requirement is based on a grouped element in a list I'm not sure how easy this approach would be to implement since you may not know how many grouped elements you'll end up with so your dummy query and subsequent union would get more complicated. I think conditionally hiding or showing group footers as I described above would be simpler.


RealQuery          DummyQuery
1                         1
2                         2
3                         3
                          4


abhijeet364

Hi Lynn,

Thanks for the suggestion. I would try the conditional formatting method and get back to you if i face any issue. Thanks once again.

Thanks & Regards
Abhijeet