Full Version: Output report to a PDF
UtterAccess Discussion Forums > Microsoft® Access > Access Q and A
phong919
Hello all,

I was wondering if anyone has a sample code to output various reports directly to a pdf file. I already have a macro setup to output it to a snapshot at this moment but need to convert the report to a pdf. Any kind of help will be greatly appreciated. thanks.
Doug Steele
Check the free ReportToPDF solution from Stephen Lebans.
kuau
Because the 'Print to local printer' function has never worked in Windows Remote Desktop (unless you have a very old printer), the way I have my clients access reports from the server database is exactly what you are trying to do.

Install Acrobat Pro on the client computer -- this automatically adds 3 pdf buttons to the toolbar and a new printer called 'Adobe PDF'. The middle button is 'Print to pdf and email to someone'. In other words, you just print the report to the "Adobe PDF' printer and email it to yourself. Works like a charm.

You can download a trial copy of Acrobat Pro from www.adobe.com to check it out.

Not sure if that was what you were looking for, but it solved my problem. Aaron
HiTechCoach
The solution by Stephen Lebans that Doug gave you a link to will event convert you existing snapshot files to PDFs!

I still save everything as a snapshot, then use the utility to convert to a PDF if needed.
phong919
Thanks for the replies.

I just looked at the utility and was wondering if i can implement that in my app with a separate macro? Or do i need to run that utility separately?
HiTechCoach
You import the code module from the sample database and then use it in your database. It is not a stand alone app.


I helped another member with a database a while back. I have attached the database that I helped them with so you can see it another database.
gandalf22
I've tired, unsuccessfully, to download and execute the utility. I keep getting security warnings from Access. Not sure what to do, or where to go....to solve this....
rfouche
Hi,

I had the same problem, and found this to be easiest solution in my case.

Download a pdf creator from www.primopdf.com, install it on your pc and simply print your report to the printer created by the utility.

The .pdf file will be created in your "my Documents" folder.

1 thing that i have found with this though is that once you have emailed the pdf. delete it from your doc folder.

hope this helps.

R
Aquadevel
I have to agree with Doug & Coach on Leban's 'ReportToPDF'
It works great, intregal to your Access application and the final end user does not need
any additional software like what the post above would require.

I'm not saying its not an option, just IMHO. sad.gif

If you import Leban's module into your database, and copy the dll file's that's in it also to
your Windows/System32 folder, you're good to go.

Good luck with your project!
phong919
Thank you for the response.

I took the necessary code to implement it in my database and it looks like it worked. The other thing that i wanted to know is, if there's a possible way for me to change the directory that the files are being save to. Let me know if you guys have any ideas. Thanks alot for the help. I'm a really amateure at this access vba stuff.
Aquadevel
Phong919,

Glad you have it working.

The following is the code I use to have the created PDF sent to a required folder:

blRet = ConvertReportToPDF("ReportA", vbNullString, "C:\Access\Delivery Delivery Ticket X" & ".pdf", False, False)

That line put the Access report named 'ReportA', into my c:\Access\ folder with the new name of 'Delivery Ticket X',
with a PDF extension.

Good luck, smile.gif


tlclady
I copied all the files and modules over to my mdb for Leban's "ReportToPDF", but I'm not understanding exactly how it is supposed to work. Can you clarify for me? When I push the "Convert" button, nothing happens....what am I missing?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.