Report to PDF first page only (1 Viewer)

Eljefegeneo

Still trying to learn
Local time
Yesterday, 16:15
Joined
Jan 10, 2011
Messages
904
I am trying to save a report as a pdf file, but I want only the first page. The problem is that the report seems to be just a little bit too long in length. I have tried the following on the report's (1) report header, (2) the page header and (3) the detail section.
Code:
  Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  'Cancel = Me.[Page] = 2
  Cancel = Me.Page > 1
  End Sub
   
  Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
  'Cancel = Me.[Page] = 2
  Cancel = Me.Page > 1
  End Sub
   
  Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
  'Cancel = Me.[Page] = 2
  Cancel = Me.Page > 1
  End Sub
The idea was to eliminate the page header which seems to be the problem as it wants to be exported as a second page.

If I use either of the two different codes above, Cancel = Me.page = 2 or Cancel = Me.page>1 I still get a second page, but it is blank. Since I am sending the pdf version of the report (it is an invoice), it shows as there being two pages.

Any suggestions?


Using Access 2010 Win 7
 

RuralGuy

AWF VIP
Local time
Yesterday, 17:15
Joined
Jul 2, 2005
Messages
13,826
If you preview the report is it more than one page?
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 16:15
Joined
Jan 10, 2011
Messages
904
No. Actually I can't really tell. I have a report header which just has command buttons on it, print, save, send as email, etc. The report is less than 10 inches high otherwise. I know I can try to shorten it, but it would look better the way it is.
 

RuralGuy

AWF VIP
Local time
Yesterday, 17:15
Joined
Jul 2, 2005
Messages
13,826
Hmm...buttons on a report. Can you preview the report? BTW, I used to live in Hayward.
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 16:15
Joined
Jan 10, 2011
Messages
904
Report preview shows two pages, the second only being the page header. that is why I only want to make a pdf of the first page. I have some hidden fields that are on the bottom 1 inch or so of the page that are only printed (appear) on certain copies of the report.

If there is no way of doing this, sending only the first page, I guess I will have to delete those fields, but I would prefer not to.
 

RuralGuy

AWF VIP
Local time
Yesterday, 17:15
Joined
Jul 2, 2005
Messages
13,826
Unfortunately, the report knows those fields are there. Can you put them in a Group Footer or something and just not print the footer unless you want to?
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 16:15
Joined
Jan 10, 2011
Messages
904
I suppose the best solution is to only have one page show up on Print Preview. This I have done by sacrificing some of the formatting of the report. I did a lot of research on this and couldn't find the answer I was looking for: some vba code that would say just send or possibly select the first page to pdf.

I can do this manually, but of course if I am sending out 50 or more invoices by email, not a good solution. The manual solution is:

Open report
Click on External Data tab
Click on PDF
On the save page select pages 1 to 1
Save.

Unfortunately Access doesn't seem to have a record a macro like Excel. I tried figuring out a macro for this, but have come up with nothing.
 

sxschech

Registered User.
Local time
Yesterday, 16:15
Joined
Mar 2, 2010
Messages
793
This may be another option to try. Scale the print size perhaps to 85 or 90%. Each version of windows and access seems to make finding this option difficult and challenging. Hadn't been doing reports for a while, so almost couldn't find it in my current work setup. This assumes that you plan to print to pdf and that you don't have acrobat professional. (If you have acrobat professional installed, then the following steps to add a printer may not be necessary, so can skip to the steps for page setup - except select Adobe rather than Konica when doing the page setup)

Before being able to scale, need to add a postscript printer.

Add a postscript printer (HP used to work, but on my setup it doesn't now, so that is why chose Konica). These steps were done using Windows7 and Access 2010. Since this isn't going to be sent to a real printer, DO NOT print a test page and don't make this your default printer.

-----------------------------------
Add Printer
Add a Local Printer
Use an existing port
File: (Print to File)
Manufacturer
Konica Minolta
Konica Minolta 360PS(P)
Next
(When you get to the screen that says Set as default, untick it)
Click Finish
------------------------

Once the printer is added, then you can modify the report to scale it.

This is somewhat convoluted.

How to get the scaling option to show up for an access report when saving to PDF without acrobat professional:

Bring up the report and go to page setup
------------------------
Page Setup
Page Tab
Use Specific Printer
Konica Minolta 360PS(P)
Properties
Advanced
Graphic
Scaling (select percentage)
Ok
Ok
Ok
Ok
--------------------------------

Then when you print, choose PDF from the Data section of the Print Preview Ribbon.

Now you can adjust any report to scale up or down to fit a particular page size. However you can't directly print it (unless you actually have that printer), so you would need to save as PDF and then print it.
 

Users who are viewing this thread

Top Bottom