By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,503 Members | 2,730 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,503 IT Pros & Developers. It's quick & easy.

How to generate report to a pdf format

P: 4
Can anyone give me an idea how to generate an Access 2007 report to a pdf format? For example, I created a Kform which will show 50 names in the form, and user will click on the checkbox to do a selection for which name that wanted to be appear in the report. Then, a Process button will be click in order to preview the report in a pdf format.

Thanks.
Really appreciate it..
Nov 25 '08 #1
Share this Question
Share on Google+
9 Replies


P: 49
I have the same situation in a DB. There is an add on you can down load from MS.
Link below, I then output to report to that format. But you need the add on

Download details: 2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS

hope that helps
Nov 25 '08 #2

P: 4
Tried to download the add-in from MS, but I can only download the Help Generator.. :(

Any other suggestions?Can I use a Macro Builder to do the task?
Nov 26 '08 #3

P: 49
You cant use macro. You need this add on
I am not sure why you where not able to download as i was able to download again . You have to go through all of the validation steps etc.
Possibly try again
Sorry
Nov 26 '08 #4

P: 4
Ok..now i can download the save as pdf from MS..so i need to do the coding to make it works, right?the thing is, im not familiar with vba..can help me with that?
Nov 27 '08 #5

P: 4
I've created this hotel list form to show hotel list in a region together with the code & a checkbox to do a selection. When user click the checkbox, let say 5 hotels, then user will click the Process cmd button in order to view the selected hotels. The output is like the image below..



http://www.geocities.com/crucial_fake/report.JPG

The question is, how can i do that?Somebody help me please. I already install the add in for save as pdf from MS.Thank You..
Nov 27 '08 #6

P: 49
What is the data source for the report? Are you only using the hotel name as criteria?
Dec 16 '08 #7

P: 1
"Then, a Process button will be click in order to preview the report in a pdf format. "

Even if it's an old post (Nov 25 '08) and because it appears on google search and has no best answer yet, I have another possible answer:

1). In your OS (windows) install a virtual PDF printer (I use PDFCreator)
2). Make sure that the PDF Printer is set to display the .pdf file ! (in PDFCreator, set the options to automatically save the .pdf file into a specific folder - it could be temp folder - and then check that checkbox to open the saved .pdf file).
3). In Access, duplicate that report (let's say "Kreport" duplicated with the name "KreportPDF")
4). In Access on that duplicated report (KreportPDF) set as a specific printer that PDF printer: "Page Setup" -> "Page" -> "Printer for KreportPDF" -> "Use specific printer" -> "PDFCreator" (in my case)
5). In Access on that Kform make a button (ProcessButton) with the on click's properties to print the "KreportPDF".

PS: I dont know why, but on this case (PDF creator), the program (PDFCreator.exe) must be started to "print/save" the .pdf file. So I added this command to open the PDFCreator.exe minimized (tray zone): Call shell("C:\Program Files\PDFCreator\PDFCreator.exe, vbMinimizedNoFocus) after the print report command. The button code looks like this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub ProcessButton_Click()
  2. On Error GoTo Err_ProcessButton_Click
  3.     Dim StLinkCriteria As String
  4.     Dim StAppName As String
  5.     DoCmd.OpenReport "KreportPDF", acNormal, , StLinkCriteria
  6.     Call shell("C:\Program Files\PDFCreator\PDFCreator.exe, vbMinimizedNoFocus)
  7. Exit_ProcessButton_Click:
  8.     Exit Sub
  9. Err_ProcessButton_Click:
  10.     MsgBox Err.Description
  11.     Resume Exit_ProcessButton_Click
  12. End Sub
Jul 17 '13 #8

P: 25
I use this in my 2007 access database to put pdf's of my reports on the network.

Expand|Select|Wrap|Line Numbers
  1.     DoCmd.OpenReport  report_name, acPreview, , , acHidden
  2.     DoCmd.OutputTo acOutputReport, report_name, acFormatPDF,  filename  , True
  3.     DoCmd.Close acReport, report_name, acSaveNo
  4.  
Jul 17 '13 #9

zmbd
Expert Mod 5K+
P: 5,287
Please keep in mind that this is a VERY old thread.
Unless you have the add-in as mention in post #2
OR
which I believe was incorporated into one of the service packs installed, then the option as given in post #9 more than likely will fail.

Microsoft originally wanted you to purchase Adobe Acrobat on your own:
---
Save as PDF
Applies to:
Access 2007, Excel 2007, OneNote 2007, PowerPoint 2007, Publisher 2007, Visio 2007, Word 2007
What is PDF format?
Portable Document Format (PDF) ensures your printed or viewed file retains the formatting that you intended. The PDF format is also useful if you intend to use commercial printing methods.

Important

Don't have the PDF option? Download and install Acrobat from Adobe Systems.
To view a PDF file, download and install Adobe Acrobat reader on your computer from Adobe Systems. Click Get Adobe Reader.
To create PDF files, download and install Acrobat from Adobe Systems.
---Note: I've disabled the links to Adobe's site in the above quote. With the release of the add-in, the above information is now obsolite.---

However, it appears that with the release of V2010 MS saw the light, realizing the people were simply going out to the internet and finding CHEAPER (!) software, shareware, and freeware instead of Adobe's software and finally released the add-in for V2007.

: to build on post #8
Many third party PDF venders have a PDF printer driver; thus:
Install the third party PDF printer driver
Set the PDF printer as default.
Now send the open report to the now default PDF printer as you would normally from within VBA. No need to shell to the program unless needed for other reasons.
Jul 17 '13 #10

Post your reply

Sign in to post your reply or Sign up for a free account.