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

Report preview is ok, report itself is not.

Status
Not open for further replies.

DirkVFP

Programmer
Aug 25, 2005
57
NL
Hello all,

Since last week some of my reports are showing strange behaviour. I usually have one cursor being 'consumed' in my reports and where it normally prints all lines, all of a sudden only the first line is printed.

On the preview the report looks good (i have all the lines on my screen), but the report itself only shows one line (head and footer are printed though).

I wondered if more people experienced this? Could it be a Windows update which starts messed things up, since I there weren't any changes on the systems where the behaviour occured?
 
So many typos after preview my post. Where's the edit button when you need one ;)
 
Something must have changed.

It sounds like you're not in the right work area when you print the report.

Tamar
 
I've been testing on different systems and the behaviour is not 100% reproduceable.

What I've found out is that whenever I print a report via the following code, the behaviour occurs roughly each 3rd or 4th time:
Code:
REPORT FORM ".\report" TO PRINTER PROMPT NOCONSOLE

Using a different setup where I use
Code:
SET PRINTER TO NAME GETPRINTER()
and programatically click the print button the behaviour does not occur.

So it seems this behaviour comes from to PROMPT parameter in the REPORT FORM command, but I'm not 100% sure.
 

Can it be that you preview not the same table/cursor that you print? Or printing from a different report version, not the one you preview?

Try somthing like this:
Code:
REPORT FORM (".\report") TO PRINTER PROMPT PREVIEW
and try printing from there. Does it still print differently from previewing?
 
Stella,

Can it be that you preview not the same table/cursor that you print? Or printing from a different report version, not the one you preview?

I'm 100% sure there is nothing wrong with the cursor I use, since my previews are always correct.

When my strange behaviour occurs, it will print the first line of either the first page or the second page (haven't tested it with report which had more pages). And it always occurs when I print with the code you've shown.
 

I'm 100% sure there is nothing wrong with the cursor I use, since my previews are always correct.
I didn't say it's not OK, I said it could be that you are printing from a different cursor, not the same you are previewing.

But you say it always occurs from that line of code I posted?

So, are you saying you open preview and it's OK, then you press the Print button right from the preview, not in a separate REPORT FORM command, and it's not OK?

Did you try to select a different printer from the list after pressing the Print button?
 
I didn't say it's not OK, I said it could be that you are printing from a different cursor, not the same you are previewing.

But you say it always occurs from that line of code I posted?

Yes, it only occurs when the user much choose a printer. But it does not occur always, roughly each 3rd or 4th time.

So, are you saying you open preview and it's OK, then you press the Print button right from the preview, not in a separate REPORT FORM command, and it's not OK?

Yep, that is, after the user selected their printer.

Did you try to select a different printer from the list after pressing the Print button?

Tested it on different printers, behaviour showed on all printers.
 

It looks like you may benefit from removing printer driver information from the report using this technique: faq184-581.
 

So, how is it going?

Did you try to remove the printer driver infor from the report?
Did you solve your problem by other means?
Would you care to share them?

 
By any chance, is this report called from a form that contains a grid? It may be that focus is landing on the grid after the user selects a printer, and thus the work area is changing.

Tamar
 
So, how is it going?

Did you try to remove the printer driver infor from the report?
Did you solve your problem by other means?
Would you care to share them?

I haven't tested it so far, another project has my attention so far, but I will post my findings here whenever I have some.

By any chance, is this report called from a form that contains a grid? It may be that focus is landing on the grid after the user selects a printer, and thus the work area is changing.

Tamar

Tamar, this form indeed contains a grid, I will look at the grid events if anything happens. Strange thing is this form is used for over 6 months now and this bevahiour never showed untill few weeks ago.
 
My guess is that the grid is grabbing focus and changing the work area. Make sure to select the right work area before calling REPORT FORM.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top