Export to PDF

M

Maureen

Hi - I am trying to have a report automatically generate
a PDF document.
I am able to set the report to default to my pdf driver -
but it then comes up asking for a file name.

What I really is for the file name to automatically
generate from a field in the record of the report.

Any help would be very much appreciated.
 
S

SA

Maureen:

This depends on the PDF printer driver that you are using. Access has no
built in facility to output PDF files or to set a file name for output
(except for its supported data types like RTF, XLS etc.)

Our PDF and Mail Library supports the PDF drivers from Adobe (v 3-6),
Win2PDF, pdfFactory, PDF995, Amynni and PDF 4 U. Once you set the proper
target driver you are using the VBA code you can add to a command button on
a form can be as simple as the following:

Dim objPDF as New PDFClass
Const PDF_ENGINE_ADOBE_PDF = 2

With objPDF
.ReportName = "Your Report"
.PDFEngine = PDF_ENGINE_ADOBE_PDF
.OutputFile = "c:\some dir\some file.pdf"
.PrintImage
End With

You'll find the Library on our web site in the developer tools section
 
M

Maureen

Thanks for your reply.
This utility looks very interesting.

Do you know if it is possible to set the name of the
document to a field from the report? ex [OrderIdNo]?
thank you again
 
S

SA

Maureen:

If as an example your report might contain multiple orders and you want to
output various PDF files, i.e. one for each order, the Library's help file
shows you how to loop through a record that might underly the report (with
all the order numbers) and output one file per order number using a SQL
WHERE clause when the PDF file is created. If you have the order ID from
that record set you can then set the file name to anything you want.
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

Maureen said:
Thanks for your reply.
This utility looks very interesting.

Do you know if it is possible to set the name of the
document to a field from the report? ex [OrderIdNo]?
thank you again
-----Original Message-----
Maureen:

This depends on the PDF printer driver that you are using. Access has no
built in facility to output PDF files or to set a file name for output
(except for its supported data types like RTF, XLS etc.)

Our PDF and Mail Library supports the PDF drivers from Adobe (v 3-6),
Win2PDF, pdfFactory, PDF995, Amynni and PDF 4 U. Once you set the proper
target driver you are using the VBA code you can add to a command button on
a form can be as simple as the following:

Dim objPDF as New PDFClass
Const PDF_ENGINE_ADOBE_PDF = 2

With objPDF
.ReportName = "Your Report"
.PDFEngine = PDF_ENGINE_ADOBE_PDF
.OutputFile = "c:\some dir\some file.pdf"
.PrintImage
End With

You'll find the Library on our web site in the developer tools section
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg




.
 
Top