Occasionally when printing a series of reports, a "no data" situation
occurs. This is OK, but what happens is that a single blank page is
printed.
-
What is the simplest thing I can do to prevent a blank page from being
issued when there is no information to print?
-
Thanks,
David

Re: Report -- How to prevent blank page when no data encountered by Paul

Paul
Sat Apr 01 11:23:08 CST 2006

IF RECCOUNT() > 0
REPORT FORM myreport TO PRINTER
ENDIF



"David" <David.Aman@dpsnc.net> wrote in message
news:1143900493.920215.101960@j33g2000cwa.googlegroups.com...
> Occasionally when printing a series of reports, a "no data" situation
> occurs. This is OK, but what happens is that a single blank page is
> printed.
> -
> What is the simplest thing I can do to prevent a blank page from being
> issued when there is no information to print?
> -
> Thanks,
> David
>



Re: Report -- How to prevent blank page when no data encountered by David

David
Sun Apr 02 10:34:51 CDT 2006

Paul -- Thanks...Just what was needed!
-
David


Re: Report -- How to prevent blank page when no data encountered by Tim

Tim
Sun Apr 02 13:35:01 CDT 2006

I have tried this in VFP6 and it does not work. As a test, I suspended
the program before the print instruction and ? reccount() gave 473
despite there being no data.

In article <#dWlsDbVGHA.4772@TK2MSFTNGP14.phx.gbl>, Paul Pedersen
<nospam@no.spam> writes
>IF RECCOUNT() > 0
> REPORT FORM myreport TO PRINTER
>ENDIF
>
>
>
>"David" <David.Aman@dpsnc.net> wrote in message
>news:1143900493.920215.101960@j33g2000cwa.googlegroups.com...
>> Occasionally when printing a series of reports, a "no data" situation
>> occurs. This is OK, but what happens is that a single blank page is
>> printed.
>> -
>> What is the simplest thing I can do to prevent a blank page from being
>> issued when there is no information to print?
>> -
>> Thanks,
>> David
>>
>
>

--
Tim Hobson

Re: Report -- How to prevent blank page when no data encountered by Paul

Paul
Sun Apr 02 14:22:59 CDT 2006

If RECCOUNT() gives 473, then there is indeed data.

First, make sure you're counting records in the table which you intended to
count.

Second, remember that RECCOUNT() includes deleted records, even if SET
DELETED is on. (That's because it doesn't actually count records; it just
reads the record count in the table header.)

There are other ways to do it. I only intended to illustrate the concept.
You could also GO TOP and check for EOF().

But I think the best way, and what I usually do, is immediately after the
main query that collects data for the report, check for _TALLY > 0. If it's
not, there's no point in continuing with other processing for the report,
because you know you have nothing to report on.



"Tim Hobson" <Tim@tjhobson.demon.co.uk> wrote in message
news:+3KKLmAVlBMEFw+m@tjhobson.demon.co.uk...
>I have tried this in VFP6 and it does not work. As a test, I suspended the
>program before the print instruction and ? reccount() gave 473 despite
>there being no data.
>
> In article <#dWlsDbVGHA.4772@TK2MSFTNGP14.phx.gbl>, Paul Pedersen
> <nospam@no.spam> writes
>>IF RECCOUNT() > 0
>> REPORT FORM myreport TO PRINTER
>>ENDIF
>>
>>
>>
>>"David" <David.Aman@dpsnc.net> wrote in message
>>news:1143900493.920215.101960@j33g2000cwa.googlegroups.com...
>>> Occasionally when printing a series of reports, a "no data" situation
>>> occurs. This is OK, but what happens is that a single blank page is
>>> printed.
>>> -
>>> What is the simplest thing I can do to prevent a blank page from being
>>> issued when there is no information to print?
>>> -
>>> Thanks,
>>> David
>>>
>>
>>
>
> --
> Tim Hobson



Re: Report -- How to prevent blank page when no data encountered by Dave

Dave
Sun Apr 02 18:44:32 CDT 2006

My guess is that there is a "for" clause in the report form statement.
there are records, just none that meet the criteria.

Dave Tiffany

Tim Hobson wrote:
> I have tried this in VFP6 and it does not work. As a test, I suspended
> the program before the print instruction and ? reccount() gave 473
> despite there being no data.
>
> In article <#dWlsDbVGHA.4772@TK2MSFTNGP14.phx.gbl>, Paul Pedersen
> <nospam@no.spam> writes
>
>> IF RECCOUNT() > 0
>> REPORT FORM myreport TO PRINTER
>> ENDIF
>>
>>
>>
>> "David" <David.Aman@dpsnc.net> wrote in message
>> news:1143900493.920215.101960@j33g2000cwa.googlegroups.com...
>>
>>> Occasionally when printing a series of reports, a "no data" situation
>>> occurs. This is OK, but what happens is that a single blank page is
>>> printed.
>>> -
>>> What is the simplest thing I can do to prevent a blank page from being
>>> issued when there is no information to print?
>>> -
>>> Thanks,
>>> David
>>>
>>
>>
>

Re: Report -- How to prevent blank page when no data encountered by Tim

Tim
Mon Apr 03 06:11:48 CDT 2006

Correct, Dave. The report follows a SQL statement and does have a FOR
clause. There are plenty of fields in the table, but none that meet the
criteria that it only reports data for the current year. I had just run
the new year program for the end of the financial year, and the next
financial year as yet has no receipts or expenses. But last years
records are all still there.

In article <O6mUk9qVGHA.4308@TK2MSFTNGP12.phx.gbl>, Dave Tiffany
<dtiffany@nospam.com> writes
>My guess is that there is a "for" clause in the report form statement.
>there are records, just none that meet the criteria.
>
>Dave Tiffany
>
>Tim Hobson wrote:
>> I have tried this in VFP6 and it does not work. As a test, I
>>suspended the program before the print instruction and ? reccount()
>>gave 473 despite there being no data.
>> In article <#dWlsDbVGHA.4772@TK2MSFTNGP14.phx.gbl>, Paul Pedersen
>><nospam@no.spam> writes
>>
>>> IF RECCOUNT() > 0
>>> REPORT FORM myreport TO PRINTER
>>> ENDIF
>>>
>>>
>>>
>>> "David" <David.Aman@dpsnc.net> wrote in message
>>> news:1143900493.920215.101960@j33g2000cwa.googlegroups.com...
>>>
>>>> Occasionally when printing a series of reports, a "no data" situation
>>>> occurs. This is OK, but what happens is that a single blank page is
>>>> printed.
>>>> -
>>>> What is the simplest thing I can do to prevent a blank page from being
>>>> issued when there is no information to print?
>>>> -
>>>> Thanks,
>>>> David
>>>>
>>>
>>>
>>

--
Tim Hobson

Re: Report -- How to prevent blank page when no data encountered by RandyBosma

RandyBosma
Mon Apr 10 16:16:50 CDT 2006

Tim Hobson wrote:
>Correct, Dave. The report follows a SQL statement and does have a FOR
>clause. There are plenty of fields in the table, but none that meet the
>criteria that it only reports data for the current year. I had just run
>the new year program for the end of the financial year, and the next
>financial year as yet has no receipts or expenses. But last years
>records are all still there.

Tim,
You could
COUNT TO nnn FOR <whatever>
IF nnn > 0
REPORT FORM thobson TO PRINT FOR <whatever>
ELSE
MESSAGEBOX("No data for thobson")
ENDIF

--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums.aspx/foxpro-general/200604/1

Re: Report -- How to prevent blank page when no data encountered by AA

AA
Tue Apr 11 03:54:24 CDT 2006

Why not prepare a cursor in a query and put the search-condition in its
WHERE clause instead of in the FOR clause of the Report command.
That way you have the exact data to be printed if any, and can do additional
calculation on that cursor beforehand. Another query with a
SELECT SUM(..) AS sum1 FROM Query1 GROUP BY .. INTO CURSOR QueryTotals
would let you show QueryTotals.sum1 at the top of the report instead of at
the bottom.
-Anders

"Tim Hobson" <Tim@tjhobson.demon.co.uk> skrev i meddelandet
news:P2SWLYB0LQMEFwou@tjhobson.demon.co.uk...
> Correct, Dave. The report follows a SQL statement and does have a FOR
> clause. There are plenty of field n the table, but none that meet the
> criteria that it only reports data for the current year. I had just run
> the new year program for the end of the financial year, and the next
> financial year as yet has no receipts or expenses. But last years records
> are all still there.
>
> In article <O6mUk9qVGHA.4308@TK2MSFTNGP12.phx.gbl>, Dave Tiffany
> <dtiffany@nospam.com> writes
>>My guess is that there is a "for" clause in the report form statement.
>>there are records, just none that meet the criteria.
>>
>>Dave Tiffany
>>
>>Tim Hobson wrote:
>>> I have tried this in VFP6 and it does not work. As a test, I suspended
>>> the program before the print instruction and ? reccount() gave 473
>>> despite there being no data.
>>> In article <#dWlsDbVGHA.4772@TK2MSFTNGP14.phx.gbl>, Paul Pedersen
>>> <nospam@no.spam> writes
>>>
>>>> IF RECCOUNT() > 0
>>>> REPORT FORM myreport TO PRINTER
>>>> ENDIF
>>>>
>>>>
>>>>
>>>> "David" <David.Aman@dpsnc.net> wrote in message
>>>> news:1143900493.920215.101960@j33g2000cwa.googlegroups.com...
>>>>
>>>>> Occasionally when printing a series of reports, a "no data" situation
>>>>> occurs. This is OK, but what happens is that a single blank page is
>>>>> printed.
>>>>> -
>>>>> What is the simplest thing I can do to prevent a blank page from being
>>>>> issued when there is no information to print?
>>>>> -
>>>>> Thanks,
>>>>> David
>>>>>
>>>>
>>>>
>>>
>
> --
> Tim Hobson