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

Printed report from Preview different than on the screen...

Status
Not open for further replies.

franksirvent

Programmer
Mar 8, 2002
358
GB
Hi
I have a report which looks perfect when on preview, but when I press the 'print button' (which is on the 'preview' screen) what I get printed in not the same as what's on preview.

The report on the screen is only 1 page, however the printed report has two pages, the last fields have 'jumped' to the next page.

I assume this is because some code is been run on the preview, then again a second time when the report is printed (from within the preview screen).

I understand that if I print the report WITHOUT PREVIEW first, it works fine, HOWEVER I need the users to preview the report everytime to check everything is correct on the report.

Is there a way I can tell acces to 'refresh' the report and start 'from the beginning when pressing the 'Print' button?

thanks
 
Have you thought about setting the margins in the print setup

Hope this helps
Hymn
 
hi
thanks for replying
I don't think I should change margins.
The report looks fine on preview or when I print it directly (without preview first)

I think the problem is because I am 'printing it twice' first when I preview, then a second time when I actually send it to the printer (from within the preview screen).

I think it must be running some code a second time when printing to printer, which might be the reason why the report becomes 2 pages long instead of 1.

I am looking for perhaps a 'refresh' option which makes the report print from zero again.

 
I agree with 'hymn' that this is most likely a margin issue. Attempt to shorten your margins by increments of .1 to see the affect on the printed report. DEpending upon the type of printer, how it is configured (i.e. fonts) and other settings, it is plausible that the preview will not match the printed report exactly.

Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
ok

thank you both for your input.
I will check the margins and do as you mention to see if that solves the problem.

I still wanted to know if there is a reason for a printed report (when printed from Preview) to print differently.
 
franksirvent,
You have twice referred to "running some code" but haven't suggested if there is any code running in the report. If there is any code, it might help if we could see it.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Hi, franksirvent.

I wonder if you've already find the answer to your question:

"if there is a reason for a printed report (when printed from Preview) to print differently"

I have the same problem, I have some report's that when i print them from the preview window, print's different not as previewed. And when I print direct to the printer it print's fine. It happens the same when I print to PDF.

I hope you reply soon :) thank's

Patricia Jocobi
 
Hi Patricia. Can you determine exactly what is different between the two reports (where there is more/less white space or anything like that)? Do you have any code in any of the Report events?

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi Patricia

Yes, I worked out the problem (at least 'my' problem)

It seems like I had some visual code running twice on the report...so the first time looked fine, but the second time I tried to print it the code RAN AGAIN, adding additional lines to the printed report.

The reason why without preview printed fine was because the code only ran once (in your case is when it creates the PDF or prints to the printer once it works fine)

I fixed by going through the code and, were it doubled up I put a counter (it took me a while to find it...)

**** code ****
i=1
if i>0 then goto jump_the_following_code
**************

That fixed my problem...
However yours might be different.
There might be better ways to fix it however this worked so 'if it works, don't touch it...'

Good luck

 
Hi :) thank's for your quick reply

I guess in my last post I didn't explain my main problem
sorry about that.
I'm runing this code in the Page Header Section Format event
Code:
Me.PageFooterSection.Visible = (Me.Page = Me.Pages)
In my report I want to be able to print the Page Footer Section only in the last page.
I run some test's and find out that my main problem is that the first time the code is run the total page number (Me.Pages)is unknown (getting the value of 0).

If my report is 1 page longer.
In the First run the values are:
Me.Page = 1, Me.Pages = 0

Later run's
Me.Page = 1, Me.Pages = 1

So when my report is of 1 page in the preview doesn't show the page footer (because for the first run the Me.Pages value is 0) and if I print from that preview, print's fine (because the Me.Pages value is no longer unknown, now is 1).

Any ideas on how to obtain the total page number before preview or print?

Thank's for the help.
Regards

Patricia Jocobi
 
I would add a text box in the Page Header section with a control source of:
=[Page] + [Pages]
and make it invisible. This might fix your problem.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top