Generate PDF Report (1 Viewer)

deadfish

Registered User.
Local time
Today, 07:36
Joined
Apr 8, 2004
Messages
10
Hi,

I have an web application which allows user to print their invoice (in pdf
format) from the browser. The application is developed using ASP and MS
Access 2003 database (the invoice is a MS Access report). I would like to know if there is any tool for such purpose, no matter it is freeware or not. Please give me some suggestions.

Thanks!
 

rainman89

I cant find the any key..
Local time
Yesterday, 19:36
Joined
Feb 12, 2007
Messages
3,015
if you have a pdf converter on your system, which im assuming u already have since they can print from the browser, you can use this code
Code:
Dim stDocName As String
    Dim strDefaultPrinter As String
    
    stDocName = "yourreportname"
    
    strDefaultPrinter = Application.Printer.DeviceName
    Set Application.Printer = Application.Printers("AdobePDFConvertername")
        DoCmd.OpenReport stDocName, acNormal
    Set Application.Printer = Application.Printers(strDefaultPrinter)
 

deadfish

Registered User.
Local time
Today, 07:36
Joined
Apr 8, 2004
Messages
10
Thanks!

But I can't assume the client has a pdf converter....The application is written in ASP..
 

StayNuts

Registered User.
Local time
Today, 07:36
Joined
Jun 26, 2007
Messages
24
if you have a pdf converter on your system, which im assuming u already have since they can print from the browser, you can use this code
Code:
Dim stDocName As String
    Dim strDefaultPrinter As String
    
    stDocName = "yourreportname"
    
    strDefaultPrinter = Application.Printer.DeviceName
    Set Application.Printer = Application.Printers("AdobePDFConvertername")
        DoCmd.OpenReport stDocName, acNormal
    Set Application.Printer = Application.Printers(strDefaultPrinter)

Did try this line of code into my database but the result is that the report still get printed out on paper. I use the default Adobe Acrobat 3D to create PDF files.
 

rainman89

I cant find the any key..
Local time
Yesterday, 19:36
Joined
Feb 12, 2007
Messages
3,015
Did you change the names to match your database accordingly?
 

StayNuts

Registered User.
Local time
Today, 07:36
Joined
Jun 26, 2007
Messages
24
Did you change the names to match your database accordingly?

Yep, I use for example...

Code:
    Dim strDefaultPrinter As String
    stDocName = "Invoice"
    
    strDefaultPrinter = Application.Printer.DeviceName
    Set Application.Printer = Application.Printers("Adobe PDF")
    DoCmd.OpenReport stDocName, acNormal
    Set Application.Printer = Application.Printers(strDefaultPrinter)

I have Acrobat 7.0 & access 2003... get slowly freaked out of it... only what I want is to push on a button and the script creates a PDF with a invoice and with the invoice number as name on my desktop...
 

rainman89

I cant find the any key..
Local time
Yesterday, 19:36
Joined
Feb 12, 2007
Messages
3,015
Yep, I use for example...

Code:
    Dim strDefaultPrinter As String
    stDocName = "Invoice"
    
    strDefaultPrinter = Application.Printer.DeviceName
    Set Application.Printer = Application.Printers("Adobe PDF")
    DoCmd.OpenReport stDocName, acNormal
    Set Application.Printer = Application.Printers(strDefaultPrinter)

I have Acrobat 7.0 & access 2003... get slowly freaked out of it... only what I want is to push on a button and the script creates a PDF with a invoice and with the invoice number as name on my desktop...

Dont know what you mean. get slowly freaked out of it?

as for saving the file to your desktop.
youll have to get some VBA to automatically save it as a pdf with the default location set to desktop and default name set to your invoice #. Try searching on that
 

StayNuts

Registered User.
Local time
Today, 07:36
Joined
Jun 26, 2007
Messages
24
Dont know what you mean. get slowly freaked out of it?
ThaI get totally nuts of it to try it out all time lah... hahahaha

as for saving the file to your desktop.
youll have to get some VBA to automatically save it as a pdf with the default location set to desktop and default name set to your invoice #. Try searching on that
Did, using {sendkeys} but then I still get a message to confirm to overwrite and within acrobat settings, I put the setting to overwrite without asking... and he stills does...

is there any ready-to-use script/manual somewhere what to do... that I can easy following it and implent it to my own system...

thx
 

Lawrenceiow

New member
Local time
Today, 00:36
Joined
Mar 10, 2006
Messages
5
I use PDF995 which has an ini file in the C:\Program Files\ folder. The ini file contains the path of where the PDF is to be saved. In vb I wrote a script which uses Write# to create my own version of the ini file which includes the path and filename of the PDF. I the used vb as per rainman89's post to do the printing part. Because this is a PDF printer driver the PDF is then saved to the location specified in the ini instead of being actually printed.
So, check to see if Acrobat 7 has an ini file (or something similar) you can edit - if the path you need to save the PDF to will always be the same you'll only need to edit it once and not worry about using write# to re-create it.
 

Users who are viewing this thread

Top Bottom