Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validating Impromptu Prompts

Status
Not open for further replies.

crsebesta

Programmer
Aug 7, 2003
3
US
What is a good way to handle invalid prompt values ?

e.g. 2 type_in date prompts (begin_date and end_date) - these prompts cannot be more than 31 days apart. If they fail validation rules, how do you communicate that to requestor of report ? If you select no data, then nothing appears on the report.

Thanks for any ideas !
 
Other than checking type consistency (i.e. a number is a number, dates are valid dates, etc), the best way to check application logic between multiple prompts is via a macro. Within the macro you can convert entered strings to dates using any format you wish, validate that they are good dates, and check any rules you wish to invoke, with meaningful error trapping and reporting to the end user, before they are passed to the Impromptu report. Check the FAQ on Impromptu Prompts to see the syntax for passing the prompts, which must be setup as strings in the report.

Hope this helps,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
Thanks for the help, Dave. I was hoping for an easier answer ... this was supposed to be a simple report the users want "yesterday". I am not very familiar with macros. Is there any documentation you can point me to, to use as a guide ? Any good examples ?

Related question ... is there a way to get the report created even when no data is selected ? (so that I can have an indication on the report "no records matched your selection criteria", or something similar) ???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top