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!

Report Printing VFP9 Sp2

Status
Not open for further replies.

boanrb

Programmer
Mar 3, 2009
53
KE
Hi Friends,

I have quite a scenario. My report (rep208z.frx) displays correctly showing all details when you issue REPORT FORM REP208Z TO PRINTER PROMPT PREVIEW command in my app.

But the moment I hit the printer button, the output comes out without the records in a way to indicate the frx printed a blank or the eof() record.

I tried issuing the SET REPORTBEAHVIOUR TO 80 command just before the REPORT command but to no avail - it still prints a blank.

All labels show correctly but all my cursor fields show blanks. Dates show " / / " and the others just blanks.

Again - The preview is just very perfect. Only the printed copy or the PDF copy, when I print to PDF drivers, behave like this.

It's a scenario where "What You See Is Not What You Get"

Any Ideas? Just moving from VFP6 and I am really lost on this - kindly assist I pray.

Benson
Data Centre
 
Are you certain that you have the 'Save Printer Environment' property NOT checked?

It sounds like you may have an 'inherited' printer setting within your Report Form.

If at this point in time you already have 'inherited' a printer setting you may have to 'hack' the Report Form's frx table to remove those settings.

Code:
USE MyRptForm.frx
REPLACE expr WITH '', tag WITH '', tag2 WITH '' FOR RECNO() = 1
USE

Good Luck,
JRB-Bldr
 
JRB-Bldr,

I appreciate your response. I will try this out then post back. What if that fails to correct the anomaly? Any more ideas? Thanks again.

Benson
 
Hi Benson,

If JRB is right and you have 'Save Printer Environment' setting NOT checked, you don't need to hack the FRX file as he suggested.

Just open the report in the report designer, uncheck the setting (on the Report menu), and save the report.

In fact, I suspect that this isn't the cause of the problem, but it would be worth trying the above, if only to eliminate it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Much appreciated Mike - will try then post back. Thanks alot.
 
Come to think of it, I vaguely remember seeing this problem once before.

If I remember right, the culprit turned out to be a grid. Somehow, the grid was grabbing focus, and this caused the current alias to change. The result was that the printed version of the report was empty.

It's a bit of a long shot, but could you check to see if there is a form open that contains a grid. If so, try removing it to see if the problem goes away.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike,

Yes, I am printing from a form that has a grid on it. I will try to remove it and see if the report renders correctly. But then again, if that is the culprit, what do I do to have it print correctly as the grid has to be there?

Thanks a lot for your answers

Benson
 
If a grid in the form you start a report fom is the problem, AFAIK it's also a problem of the preview, but who knows.

Setting focus to some textbox or other control might solve that problem, if there is nothing, that is able to get focus but a grid, you can add a textbox off screen perhaps, set it's tabstop to .F., so it can't be focused by TABBING, but you can programmatically set focus to it, before REPORT FORM is called.

Another hint: There were 2 SPs and 3 Hotfixes for VFP9, and especially the hotfixes adressed report problem. You should update to SP2 first


After updating to that level your version number Version(4) should be 09.00.0000.5815

Then apply the latest hotfix (they are cumulative, though advertised otherwise)


Download and install KB968409

Also see here:
Even if you don't find your report problem in there, try it, the report engine was changed much from the SP0 version.

Bye, Olaf.
 
Benson,

In addition to Olaf's suggestions, you could try disabling the grid just before you start the preview, and re-enabling it afterwards. The point is to stop the grid getting focus.

Let us know if you manage to solve the problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Good guys,

- thanks. I will let you know after I have done as per your suggestions.

Benson
 
you have 'Save Printer Environment' setting NOT checked, you don't need to hack the FRX file as he suggested.

Mike - since he says: Just moving from VFP6 and I am really lost on this I am guessing that maybe the Report Form could have been created in VFP6. If so, it might have 'inherited' printer environment settings back then and might still contain them.

I have not upgraded Report Forms from one version of VFP Report Form to another version where the Printer Settings was not already 'hacked' so I don't know if now setting an old VFP6 Report Form to DO NOT Save Printer Environment will delete previous settings.

Benson - another question...
Have you put a SET STEP ON into your code immediately in front of the REPORT FORM command and halted your code's execution in the VFP Development mode?

At that point you should be able to, via the VFP Command Window, do a BROWSE NORMAL of the intended data table records to confirm that at the precise moment that you want to print, the records are as you expect them to be.
And subsequently you could do a more 'realistic' REPORT FORM command of the report through the VFP Command Window to see if those same records were being 'seen' and represented in the report output.

Good Luck,
JRB-Bldr
 
JRB,

You might well be right regarding upgrading from 6.0. I haven't done this either, so I can't be sure (or, if I have done it, it was a long time ago and can't remember the details).

But, the more I think about it, the more I feel that Benson's problem is not connected with the printer environment. But I might be wrong, and your suggestion would certainly be worth a shot.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Hi Friends,

I have applied the sp2 and 'hacked' the .frx table , the same old problem.

When I do a BROWSE, just before calling the REPORT FORM command, I see the records I want to print. The report PREVIEW is pretty fine, showing exactly what I want, until I hit the printer Icon - I get a blank. (This is from the compiled EXE not from DE)

Now, the interesting thing is, I converted all the Remote views the frx was printing from, to tables, opened them and ran the REPORT FORM command from the command window, and everything was really fine. I hit the print icon and got the exact copy of the preview - no blanks.

Whatever I am missing out is REALLY unknown to me - really.

Is there a difference when printing from remote views and using local tables?

By the way, I appreciate all your thoughts on this.

Benson
 
Do you have a grid in your form and has it focus, or does that not apply at all. I ask because you don't mention having done that at all.

Also, did you apply the hotfix KB968409 after applying the SP2?

You introduce new info about using remote views, but actually I don't see how that makes a difference, you don't requery within report exection, foxpro does also not, even if you change view parameters it would not have an affect, but I would check if a report uses report variables with the same name as view parameters. That's the only connection I could imagine influencing the view data in between preview and real print. View parameters being at some changed values, if used as report counter variables, too.

Bye, Olaf.
 
Hi Guys,

I did not mention anything about the grid and sorry for this. I did put a text box (as Olaf suggested) which just before the REPORT FORM command, gets the focus.

I also did disable the grid just before the REPORT FORM command then enabled it there after. but this did not matters any better.

As for the hotfix, I will apply the hotfix then report back.

I really appreciate your help once again. Thank you.

Benson
 
Regardless of what has focus within the Form, are you doing a SELECT of the report data records immediately before the REPORT FORM command?

If so, then when you tested with the SET STEP ON, you should have been able to see the indended report record set with the BROWSE NORMAL.

Something like:
Code:
SELECT ReportRecs
* -- For Debugging only --
* -- Issue BROWSE NORMAL in Command Window after the Break --
SET STEP ON  
REPORT FORM MyReport NOCONSOLE TO PRINTER

Also, you don't by chance have a Private Data Session within your Report Form do you?

Good Luck,
JRB-Bldr
 
JRB-Bldr,

No. I do not have a Private Data Session within my report. and yes I did a browse and saw the actual record set I wanted to print.

I applied the hot-fix but things remain the same. I'll keep trying all possible means to get to the problem.

Benson
 
Here is another 'stab in the dark' thing to try.

After going to the SET STEP ON immediately before the existing REPORT FORM command, go to your Command window and create a New Report Form - TestReport.

In that Report Form lay out the text boxes that you want, using the record set fields, etc. and the go back to the Command Window and issue a REPORT FORM TestReport NOCONSOLE TO PRINTER

If that one prints out as expected, then that might point to a problem within the existing Report Form itself.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top