Re: Page Header with no records needed
Posted in 1993
In article <bobbCF7n3G.6DG@netcom.com>, bobb@netcom.com (Bob Beaulieu) writes:
> Still looking for a way to work around this problem. Any ideas?
>
> I need to be able to run a select and if NO data is found, still print the
> header and comments "No Data found". Our personnel department wants a hard
> copy showing they ran the report and there weren't any records found.
>
> There are many reports like this that were working just fine under 4.00; but,
> this upgrade to 4.10 no longer does it.
Brady Chang of Informix's tech support in Kansas found a work-around for the
problem.
If I create a flag char(1) and in the page header check to see if one of the
columns I've selected is null (assumming if no records found, the column would
be null) and if so, I set the flag to equal "T"; then, the page header prints.
I can then check "on the last row" section and if flag is "T" print a message
"No records found!".
database mydb end
define flag char(1) end
select col1,col2,col3 from table a end
format
page header
if col1 is null then let flag = "T"
print "Printed on ",today," at ",time[1,5]
skip 2 lines
print col 20,"COMPANY NAME"
print col 20,"ADDRESS"
on every row
...
on last row
if flag = "T" then
print "No rows were found!"
end
This will do until a better solution comes along.
Thanks Brady,
Bob Beaulieu
--
___________________________________________________________________________
|EZ TRAVEL (Bob Beaulieu) Internet : eztravel@netcom.com |
|4640-B Meridian San Jose, CA 95124 Telephone: (408) 978-0808 |
|---------------------------------------------------------------------------|
| $Best Fares$.........Great Service.......International/Domestic |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~