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 you Render specific pages in Cognos using conditional variables

Started by jaymoore1756, 04 Dec 2012 04:14:05 PM

Previous topic - Next topic

jaymoore1756

I have five letters (five pages) in a Cognos report. The letters are in response to NSF checks received by the company . Each letter is different and is generated based upon flags that are set in the NSF file. The letter gets generated in a collection stream process during the evening processing. I need to render 1 letter ( suppress 4 ) based upon the flags that have been set in the file. For example -- if the customer 1 has never had an NSF check. Then print a nice letter ( page 1). If the customer has had other NSF check then letter 2 ( page 2 ) and so on. The following is the conditional logic for printing the letters --- 1,2 3,4,5 represent each page.....

IF [Main].[RETURN_REASON_CD] = 'FINAL' Then '1' Else (
IF [Main].[RETURN_REASON_CD] = 'FIRST' AND [Main].[METHOD_OF_DRAFT_OVR] = 'ACHDA' Then '2' Else (
IF [Main].[RETURN_REASON_CD] = 'FIRST' AND [Main].[METHOD_OF_DRAFT_OVR] <> 'ACHDA' Then '3' Else (
IF [Main].[RETURN_REASON_CD] NOT IN( 'FIRST', 'FINAL') AND [Main].[METHOD_OF_DRAFT_OVR] = 'ACHDA' Then '4' Else  '5')))

When I run this in report studio all five pages are rendered.  Any help or assistance at creating the conditional variable would be greatly appreciated.

cognostechie

Create a String Variable with your condition.

IF [Main].[RETURN_REASON_CD] = 'FINAL' Then 'One' Else (
IF [Main].[RETURN_REASON_CD] = 'FIRST' AND [Main].[METHOD_OF_DRAFT_OVR] = 'ACHDA' Then 'Two' Else (
..............


Add five values (one, two, three, four, five) Go to Report pages, click page1. In the 'Render Variable' property, select the variable you created. Select only one value (one) in the 'Render For' section. Click on Page2, repeat the same steps but select another value (two). Do the same for other pages.

jaymoore1756

ok I created a string variable and called it Retrn_Chk_Reason I added the values 1 - 5. At the page level, I rendered the string with one value and ran the report and got the following error.. ( see attachment ) Thanks

jaymoore1756

Update --- In the collection stream there is a detailed filter [WORK_TRXN_NO] = ?WorKTransNo? that is used to get the record for the letter. does that need to be included variable ?

blom0344

You probably forgot to associate a dataitem with the page (through the page properties) If you use a variable that refers to a dataitem that is not used in a datacontainer you need to associate it through the datacontainer properties setting

jaymoore1756

You probably forgot to associate a dataitem with the page (through the page properties) If you use a variable that refers to a dataitem that is not used in a datacontainer you need to associate it through the datacontainer properties setting  --

Can you give an example of this ..thanks

blom0344

Well, like I wrote. Suppose you define a variable against a data-item from a query that is not used in the datacontainer where the variable is developed for then the association does not exist. This typically leads to error messages like the one you get.
For report and list you can associate the dataitem through the properties 'properties' setting. For a crosstab you do this through the crosstab header (no idea why this is different)