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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

macros and null data 1

Status
Not open for further replies.

smartglass

IS-IT--Management
Mar 14, 2006
33
GB
Hi There:
I have written a macro that faxes to our customers a daily report of orders. Naturally, not all customers place orders every day.
I am trying to write an "If..else" statement that says that if the report returns no data (I mean nothing at all..not even customer name) then pass over this customer and run the report for the next customer. However Null, Empty, and missing statements all stop the macro at the point where I call "ImpRep.GetDataValue(1,1)".
Could somebody please advise as to how I can generate a macro that passes over a report that generates absolutely no data?
Thanks in anticipation!
 
Hi smartglass,

What I usually do in this case is to have a second report that is always called first. This report is a summary-only report that returns a count for the number of rows that meet the criteria for the final report. I usually write it without a filter for the condition. Rather, I use a calculated column. That way the summary report always returns rows. It just may not include them in the counter.

Run this report before running the actual report, use the GetDataValue call with the summary report to read in the row counter, then bypass the report if zero rows are returned.

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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top