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

Save report as PDF automatically

100+
P: 116
Hi there.

I have searched the forum and various other websites but cant seem to get the answer. I am sure this must have been asked before.

I basically need to click a button in a form which automatically saves a report to a folder in my c drive/jobbag folder as a pdf. If its not possible then a snapshot would do. I dont want to be asked any questions just want it to save automatically. At the moment I just open the report in preview and use Cute PDF but its too long winded.

Thanks
Jacc14
Oct 3 '08 #1
Share this Question
Share on Google+
6 Replies


ADezii
Expert 5K+
P: 8,679
To automatically Save the rptEmployees Report in Snapshot Format to the C:\Test\ Directory and name it Employees.snp:
Expand|Select|Wrap|Line Numbers
  1. Dim strReportName As String
  2.  
  3. strReportName = "rptEmployees"
  4.  
  5. DoCmd.OutputTo acReport, strReportName, "SnapshotFormat(*.snp)", "C:\Test\Employees.snp", False, "", 0
P.S. - It is my understanding that Access 2007 can directly Save a Report in *.pdf Format, but first you must install a free Microsoft Add-In.
Oct 3 '08 #2

Expert Mod 2.5K+
P: 2,545
Hi. To add to ADezii's post, Stephen Lebans has a sample DB at the link below which outputs reports to PDF, using snapshot as an intermediate format to do so (there are no native ways to output to pdf if you are not using A2007). The sample database shows how the modules concerned can be incorporated into your own DB if you wish to use them.

It is all the more remarkable because the code concerned was written from scratch to output to PDF - it does not use commercial drivers or the like. As long as the copyright conditions on acknowledgement and usage are met the code is usable licence-free.

The link is http://www.lebans.com/reporttopdf.htm.

-Stewart
Oct 3 '08 #3

100+
P: 116
Many thanks for this.

I will give it a go but looks exactly what i need.

Jacc14
Oct 6 '08 #4

100+
P: 116
Hi again.

Just investigating but our Software developer has just ask if we can do similar using Postscript file. eg so it automatically saves as .ps. Have tried the snapshot and this works as i want it but unfortunately the person opening the file at the other end doesnt have access so it doesnt open the report.

Many thanks

Jacc14
Oct 6 '08 #5

Expert Mod 2.5K+
P: 2,545
Hi. If it is Snapshot you are referring to, if the user does not have Office you will need the Microsoft snapshot viewer to see the results (available free from MS). If it is the PDFs as in the Lebans database then Acrobat Reader is freely available - there should be no problem in viewing these.

I know of no utilities which automatically save files to postscript as such for Access, though ADezii may know better than I if there are such utilities available, but even so it should be possible to install a postscript printer at the originating end and set its parameters to save to postscript file if this is what you need. Personally, I'd stick to either Snapshot or PDF.

-Stewart
Oct 6 '08 #6

100+
P: 116
Hi there.

Success. We are going with the snapshot route and your code you sent was spot on and very simple to use.

Thanks for your help

Regards

Jacc14
Oct 7 '08 #7

Post your reply

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