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!

Display error message if No records are returned.

Status
Not open for further replies.

Halfcan

Technical User
Dec 8, 2002
214
US
Hey there,

If my report returns no records, I get a blank white page.

I want to Display an error message if this happens.

I've been messing with a section in group 1, containing a text box which I want to be suppress unless no records are returned, but I can't seem to get it to work.

Do I put the formula in the "Suppress Blank Section" area, or the "Suppress (No drill Down)" area?

Should it be checked or unchecked?

Should I base my anaylsis on a formula that works at the details level, or should it be based on a group?

My report is based on ticket numbers. If I have 0 tickets then nothing will display. Should I base my decision on this?

Thanks
Andy

 
I think this has something to do with select expert. Text boxes in the Report and page headers will not even appear, and I have no formulas on these.

In my select expert statement, I have 1 line that must be true at least 1 time for a report to be generated:

{Tickets.IP Address} = {DeviceList.IP Address}
these are string fields.

Does anyone know why I can't even get a normal text box to appear all the time, when select expert's criteria is not met?

********Start of Select expert:
{Tickets.Date Device UP} in
Switch
(
{?Quarter} = "1st quarter",
CDate({@YearConvert}, 1, 1) To CDate({@YearConvert}, 3, 31),
{?Quarter} = "2nd quarter",
CDate({@YearConvert}, 4, 1) To CDate({@YearConvert}, 6, 30),
{?Quarter} = "3rd quarter",
CDate({@YearConvert}, 7, 1) To CDate({@YearConvert}, 9, 30),
{?Quarter} = "4th quarter",
CDate({@YearConvert}, 10, 1) To CDate({@YearConvert}, 12, 31),

{?Quarter} = "Year to Date",
CDate({@YearConvert}, 1, 1) To CurrentDate,
True, // provide default handling and specify a valid range
CDate(1899, 12, 30) To CDate(1899, 12, 30)) and
(If {?Reason Code}[1] = "All" then
true
else
if {?Reason Code}[1] <> &quot;All&quot; then
{Tickets.Reason Code} = {?Reason Code}) and
{Tickets.IP Address} = {DeviceList.IP Address} and
{DeviceList.Vendor} <> &quot;Management&quot; and
(If {?Market}[1] = &quot;All&quot; then
{DeviceList.Region} <> &quot;Oregon&quot;
else
if {?Market}[1] <> &quot;All&quot; then
{DeviceList.Region} = {?Market})

********END******

Please help,

Andy
 
Thanks synapsevampire, I've figured out how to use a formula to display or not display a section,
But my problem now is that nothing displays if the record generates no records.
Normally even if none are returned, you should see something - a page header, and regular text boxes.
My report shows nothing. the page is completely blank.
Text boxes should at least be shown no matter what the report returns.

Any more ideas?

Thanks,
Andy
 
I had a similar problem, looking for transactions from a main record. I created a section saying &quot;No transactions&quot;, which would be suppressed on the following
not isnull(tran.code)

This meant it appeared when nothing was found, and I got a clear signal that nothing had been found.

Does this help?

Madawc Williams
East Anglia, Great Britain
 
Still haven't figured this out, On other reports, if no records are returned, I at least get the page header and page footer to appear.
For this report, if no records are returned, the page is completely blank. No page header or footer.

If I can fix this, then I know how to create the error message function that I started this post out with, but until I get the Page Headers and Page Footers to work normally, the error message function will not work.

Thanks,
Andy
 
I think the only time you will get an entirely blank report is if there is an error in the record selection or in a formula that CR cannot resolve. I can't really tell what's wrong with your record selection formula, but I wonder why you have all your parameter's subscripted. I would play around with the formula and test different parts of it. For example, does the report return records without the parameter section--just with the switch statement? Maybe you can narrow down the problem this way.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top