PDA

View Full Version : Printing a series of reports


ABC123

Rokrz
05-07-2002, 07:08 AM
I would like to write a script to print a series of reports from the same database. The problem that I have is that there are times when one or more of the reports do not find any records to match the search parameters. This causes the script to stop. What can I write into the script to carry on if this condition happens.

In the past I have created dummy records but this method creates other problems in the reports.

peter littleton
05-07-2002, 10:55 AM
I write a script that does OIF (Other Info Field Stats) I put in a search such as IF(date=date(),1,0) This places the total of 1's in %system_stat1_sum. I then say if %sys_stat1_sum>0 then Play Script1 If not Play Script2. If there are no records, it will go to script2 which will continue processing. If script1 runs, then it will continue to script2 after succes.
Be sure to place the Clear %sys_stat* line before you do the OIF

Ken L Herrold
05-09-2002, 05:18 PM
Robert:

I read this yesterday and fooled around with it. If you first run a search and then print 'current selection' Littleton's idea is good but I can see that %sys_search_count could be the determining factor on whether the print is ordered.

Let's say you have three reports, each based on a saved search. Your script would run the first search, if the search count is greater than 0 run the print. Then run the second search and if that sys_search_count is greater than 0 run the second print., etc etc.

These are just ideas. All of my reports print from 'explicit search parameters' at print time. Just never thought to do what you're doing - pretty good idea.

Ken