Print Reports into PDF's

C

Curtis Stevens

I have my reports setup with a specific printer (PDF Printer) under Page
Setup, but wanted to know if it is possible to set it up so you can specific
the file path and name of the newly created PDF programming wise?

Any tips, pointers or suggestions is greatly appreciated! I don't know if
this is a very complicated task or not.

Thanks
Curtis
 
C

Cyber-guy

Curtis said:
I have my reports setup with a specific printer (PDF Printer) under Page
Setup, but wanted to know if it is possible to set it up so you can specific
the file path and name of the newly created PDF programming wise?

Any tips, pointers or suggestions is greatly appreciated! I don't know if
this is a very complicated task or not.

Thanks
Curtis


You can download Stephen lebans' pdf converter at
http://lebans.com/DownloadFiles/A2000SnapshotToPDFver751.zip

I have an app that creates a sequentially numbered report and saves it to
<reportname+###>.pdf and it works nicely, in fact you don't need a pdf print
driver to do it.

Cyber-guy
 
C

Curtis Stevens

How do I specify the file path directory? Also, it keeps opening the file
after it prints, how do I get it to not open, as I click another button that
attaches it to an email, so I don't need to see it.

blRet = ConvertReportToPDF(Me.PDFApproved, vbNullString, _
Me.CustomerID & ".pdf", False, True, 0, "C:\USMS\", "C:\USMS\", 0, 0)
 
C

Cyber-guy via AccessMonster.com

Curtis said:
How do I specify the file path directory? Also, it keeps opening the file
after it prints, how do I get it to not open, as I click another button that
attaches it to an email, so I don't need to see it.

blRet = ConvertReportToPDF(Me.PDFApproved, vbNullString, _
Me.CustomerID & ".pdf", False, True, 0, "C:\USMS\", "C:\USMS\", 0, 0)
[quoted text clipped - 14 lines]
Cyber-guy


This is the code from a sample recipe db I wrote - click the button and it
saves the recipe report in a specific location without opening acrobat.

Dim blRet As Boolean
blRet = ConvertReportToPDF("Recipes", vbNullString, "c:\stuff\Recipes2"
& ".pdf", False, False, 0, "", "", 0, 0)

If you check the comments in the Lebans sample you'll find the options for
his function:

'Public Function ConvertReportToPDF( _
'Optional RptName As String = "", _ "Recipes" in my example
'Optional SnapshotName As String = "", _
'Optional OutputPDFname As String = "", _ "c:\stuff\Recipes2" & ".pdf",
in my example
'Optional ShowSaveFileDialog As Boolean = False, _ if you make true you get
file save dialog window
'Optional StartPDFViewer As Boolean = True, _ False will not open acrobat
'Optional CompressionLevel As Long = 0, _ changes compression level
'Optional PasswordOwner As String = "", _
'Optional PasswordOpen As String = "", _
'Optional PasswordRestrictions As Long = 0, _
'Optional PDFNoFontEmbedding as Long = 0 _ font embed enabled =0, disbled=1

you can use variables to build the output name. I'm using this in an
inventory program that generates a unique report number each time a report is
generated. I append that number to the file name so that I have a collection
of all of the reports generated in a format that users can understand.

If you'd like a copy of my recipe db - post your email & I'll send it to you.
Remember to add his ReportToPDF module into the module section of your db.
Unless your using some of his super formatting stuff you don't need the
clsCommonDialog

Cyber-guy
 
C

Curtis Stevens

Thanks, one last question.

On the location address, I'm can't get it to work.

My customer's personal folder rests here: C:\USMS\Customers\XXXX\

There is a folder there with a unique number, which is the number of their
record (me.customerid). I want the record to create the file using
me.customerid as the file name it place it in their approperiate folder such
as Example Merchant with customerid of 500, should be

C:\USMS\Customers\500\500.pdf

Thanks
Curtis
Curtis said:
How do I specify the file path directory? Also, it keeps opening the file
after it prints, how do I get it to not open, as I click another button that
attaches it to an email, so I don't need to see it.

blRet = ConvertReportToPDF(Me.PDFApproved, vbNullString, _
Me.CustomerID & ".pdf", False, True, 0, "C:\USMS\", "C:\USMS\", 0, 0)
I have my reports setup with a specific printer (PDF Printer) under Page
Setup, but wanted to know if it is possible to set it up so you can specific
[quoted text clipped - 14 lines]
Cyber-guy


This is the code from a sample recipe db I wrote - click the button and it
saves the recipe report in a specific location without opening acrobat.

Dim blRet As Boolean
blRet = ConvertReportToPDF("Recipes", vbNullString, "c:\stuff\Recipes2"
& ".pdf", False, False, 0, "", "", 0, 0)

If you check the comments in the Lebans sample you'll find the options for
his function:

'Public Function ConvertReportToPDF( _
'Optional RptName As String = "", _ "Recipes" in my example
'Optional SnapshotName As String = "", _
'Optional OutputPDFname As String = "", _ "c:\stuff\Recipes2" & ".pdf",
in my example
'Optional ShowSaveFileDialog As Boolean = False, _ if you make true you get
file save dialog window
'Optional StartPDFViewer As Boolean = True, _ False will not open acrobat
'Optional CompressionLevel As Long = 0, _ changes compression level
'Optional PasswordOwner As String = "", _
'Optional PasswordOpen As String = "", _
'Optional PasswordRestrictions As Long = 0, _
'Optional PDFNoFontEmbedding as Long = 0 _ font embed enabled =0, disbled=1

you can use variables to build the output name. I'm using this in an
inventory program that generates a unique report number each time a report is
generated. I append that number to the file name so that I have a collection
of all of the reports generated in a format that users can understand.

If you'd like a copy of my recipe db - post your email & I'll send it to you.
Remember to add his ReportToPDF module into the module section of your db.
Unless your using some of his super formatting stuff you don't need the
clsCommonDialog

Cyber-guy
 
C

Cyber-guy via AccessMonster.com

Curtis said:
Thanks, one last question.

On the location address, I'm can't get it to work.

My customer's personal folder rests here: C:\USMS\Customers\XXXX\

There is a folder there with a unique number, which is the number of their
record (me.customerid). I want the record to create the file using
me.customerid as the file name it place it in their approperiate folder such
as Example Merchant with customerid of 500, should be

C:\USMS\Customers\500\500.pdf


"C:\USMS\Customers\"&[me.customerid]&"\"&[me.customerid]&".pdf" should give
you the correct path and name

Cyber-guy
Thanks
Curtis
[quoted text clipped - 44 lines]
Cyber-guy
 
C

Curtis Stevens

I replaced [] with () and it worked!

Thanks!!

Curtis

Curtis said:
Thanks, one last question.

On the location address, I'm can't get it to work.

My customer's personal folder rests here: C:\USMS\Customers\XXXX\

There is a folder there with a unique number, which is the number of their
record (me.customerid). I want the record to create the file using
me.customerid as the file name it place it in their approperiate folder such
as Example Merchant with customerid of 500, should be

C:\USMS\Customers\500\500.pdf


"C:\USMS\Customers\"&[me.customerid]&"\"&[me.customerid]&".pdf" should give
you the correct path and name

Cyber-guy
Thanks
Curtis
How do I specify the file path directory? Also, it keeps opening the file
after it prints, how do I get it to not open, as I click another button that
[quoted text clipped - 44 lines]
Cyber-guy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top