Report Formatting in PDF (1 Viewer)

Eljefegeneo

Still trying to learn
Local time
Yesterday, 22:49
Joined
Jan 10, 2011
Messages
904
I have a two page report that is showing an extra page at times. The code I use to send the report is:

Code:
  DoCmd.SendObject acSendReport, MyRpt, acFormatPDF, MyEmail, Nz(Forms!frmContracts.ECC, ""), Nz(Forms!frmContracts.EBCC, ""), "Contract for" & " " & [CStationName], Format(Date, "Long Date") & Chr(10) & Chr(13) & Chr(13) & MsgSt
It seems to work fine on my computer, that is, it only sends the two pages of the report to pdf format. But on one or two other computers at work it adds a third page to the report when sending it as a pdf, the third page blank except for the header.

The first page of the report is a contract; the second page is merely the boiler plate that one usually finds on the revere side of a contract. Page one and page two are split up with a page break.

Is there some way to send only two pages to the pdf format to be included with the email. Something like the way you can set a print object to only print two pages.

And yes, I have fiddled with the size of the report pages.

What drives me crazy is that it works fine on one computer but not another.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:49
Joined
Aug 30, 2003
Messages
36,125
The report is rendered using the default printer on the computer. Have you experimented with using the same one?
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 22:49
Joined
Jan 10, 2011
Messages
904
What happens is the report looks like two pages when it appears before converting to pdf. But when you click on the pdf file after converson, it shows three pages. This is sent to the client, so it is hard to tell them to print only two pages without looking like we don't know what we are doing.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:49
Joined
Aug 30, 2003
Messages
36,125
Have you tried with the same default printer?
 

isladogs

MVP / VIP
Local time
Today, 06:49
Joined
Jan 14, 2017
Messages
18,216
Have you checked if the default 'paper' size is the same e.g. A4
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 22:49
Joined
Jan 10, 2011
Messages
904
The default is Letter (standard USA) 8-1/2 X 11 inches.

Perhaps I am not explaining it correctly. The sequence is first the report is shown in regular Access report view so the user can double check it (it is a contract). Then the user can save it to disk as a pdf file and send it via email.

In report form it is only two pages. In pdf format it sometimes shows a third blank page except for the header which appears.

Only the email recipient will see the pdf attachment and print it.

If one cannot manipulate the output to pdf to say only two pages, then I assume my only recourse is to fiddle with the page sizes until it only shows two pages on any and all computers. Yes/no?
 

isladogs

MVP / VIP
Local time
Today, 06:49
Joined
Jan 14, 2017
Messages
18,216
It's the 'sometimes' part that's slightly odd.
Perhaps 'sometimes' the pdf uses A4 which is I believe slightly shorter....though I'm not at all convinced by that.

The fact that you get a third blank page suggests your report ends on the limit of the second page. Reduce the margins slightly or move something up to reduce white space...again by just a small amount
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 22:49
Joined
Jan 10, 2011
Messages
904
I did reduce the margins slightly and asked the user to check it. Hopefully that is the end of this problem.
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 22:49
Joined
Jan 10, 2011
Messages
904
Update on this. I remotely went to the server and tried to duplicate the problem but couldn't. The one user still has the problem. The copy of the front end is the same as mine, all page setup conditions are the same.

I even opened up the contract in report form, used the external data tab and saved it to my Dropbox. When I opened it up, it was two pages.

Can one user sending it to PDF be different from another user?

Haga me loco!
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:49
Joined
Aug 30, 2003
Messages
36,125
Still haven't tried using the same default printer?
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 22:49
Joined
Jan 10, 2011
Messages
904
It isn't the printer, it is sending it to a pdf file for attachment to an email. When I send it to pdf om my computer or when I just tried it using the front end on a computer at work via LogMeIn, I get two pages. Yet the the user with the problem still gets a third page when he sends it to a pdf file. We both use the same front end, that is, his copy is exactly the same as mine.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 22:49
Joined
Aug 30, 2003
Messages
36,125
Yes, I understand. The default printer driver is used to render the report. Different drivers can render it differently. That could affect how it converts to PDF. Isn't it at least worth a try?
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 22:49
Joined
Jan 10, 2011
Messages
904
It will be the first thing I try tomorrow.
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 22:49
Joined
Jan 10, 2011
Messages
904
:banghead:Had the user switch default printers. Same result. Either when the user clicks on the command button to automatically save the report as a pdf file or if he opens the report and uses the ribbon to save it (publish it) as a pdf file, he still gets three pages.

Any other suggestions? I am thinking that I might have to split the report into two sections, page one and page 2 independently of each other. But that might cause some confusion on the part of the recipient of the email.
 

Mark_

Longboard on the internet
Local time
Yesterday, 22:49
Joined
Sep 12, 2017
Messages
2,111
Can one user sending it to PDF be different from another user?

YES.

From your description, the settings for the ONE USER who is having an issue are different for Adobe than from your computer.

As the print job coming from ACCESS is only two pages when printed to paper, I'd take a look at what their settings are in their PDF print driver. This could be as easy as "Which printer did you last print to BEFORE trying to save".

Please remember, the print job comes from ACCESS and is sent to a printer driver. The "Printer" tells ACCESS things like how large the print area is (so pagination works) as well as if it can handle color. In this case, since it goes to a PDF print driver, that print driver is probably looking at the last print job the user did for things like "What printer" to determine what its print area is.

You will need to work with the user who has this problem some of the time to find out what else they were doing BEFORE they tried to create the PDF. You may find they do "X" first, then get the error. Then you can tell them "Don't do that first".
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 22:49
Joined
Jan 10, 2011
Messages
904
Thanks for the input. I’ll talk with him and see what he has been doing.
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 22:49
Joined
Jan 10, 2011
Messages
904
The problem was what you said it might be. Since the computer at the office that the user accesses remotely did not have a local printer attached as a default printer, I had him set the server printer as his local printer. Now seems to work OK.

However, the strange thing is that a similar contract, almost the same, worked fine before this. But as been said many times on this forum, problem fixed, case closed, on to the next item.

I sincerely appreciate you taking the time to walk me through this.
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 22:49
Joined
Jan 10, 2011
Messages
904
Forgot to mention. Rooting for the Golden Knights tonight.
 

Mark_

Longboard on the internet
Local time
Yesterday, 22:49
Joined
Sep 12, 2017
Messages
2,111
Very glad you have a resolution.

Biggest down side of printing to PDF is that you are dependent on how the PDF Driver wants to behave, not just what ACCESS is trying to do.
 

Users who are viewing this thread

Top Bottom