COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Anna711 on 23 Dec 2013 01:47:09 AM

Title: Render Variable based on a date parameter
Post by: Anna711 on 23 Dec 2013 01:47:09 AM
Hello,

I have a report with 2 date prompts: Start_Date and End_Date. The default selection for "Start_Date" is Jan 1, 2000. I want to report to run only when "Start_Date" is not equal to 'Jan 1, 2000'. I tried creating a variable: ParamDisplayValue('Start_Date')<>"Jan 1, 2000". This doesn't seem to work.

I would greatly appreciate any ideas on the matter.

Thanks a lot!
Title: Re: Render Variable based on a date parameter
Post by: navissar on 23 Dec 2013 02:36:35 AM
Hi Anna,
Try this on for size:
ParamValue('Start_Date')<>'2000-01-01'.

If this doesn't work drag a layout calculation to the report, and set it to ParamValue('Start_Date'), see what the format is and copy it.

That being said, if you're using 10.2 and up you could use Cognos prompt API to disable the finish button as long as start date is 1.1.2000 (Or even as long as start date is smaller than X). You can do this in earlier versions, but the code is a bigger effort. I think, however, this is a more elegant solution: rather than have your user submit a report and getting an empty page, they won't be able to submit (And you could add in a little notification as to the reason they cannot submit).
I have a working sample of this on 10.2 I could send your way if it's relevant.
Title: Re: Render Variable based on a date parameter
Post by: Anna711 on 23 Dec 2013 02:39:37 AM
Hi Nimrod,

I've already figured out the 1st solution you've suggested and it worked fine.

Thanks a lot!