Reports as PDFs

M

MacNut2004

Hmmm...I tried doing what you suggested but nothing happened -- the file was
not saved where i tried to place it, nor did the report even open up.
(changed the first "true" to "false" as well.
 
S

Stephen Lebans

Doug, first and foremost thank you for helping out with this thread. I
honestly don't know how I missed it.


MacNut, you don't want the File Dialog window to popup as you are supplying
the output filename and path.

blRet = ConvertReportToPDF(Me.lstRptName, vbNullString, "C:\" &
Me.lstRptName.Value & ".pdf", False)

If you do not want the function to try and display the saved PDF in the
Registered PDF app on your system then simply add another False param at the
end of the function call.
blRet = ConvertReportToPDF(Me.lstRptName, vbNullString, "C:\" &
Me.lstRptName.Value & ".pdf", False, False)

I'm not sure why you are having a problem here with the function call. It is
detailed in the source code behind the sample HowToUse form.

' The function call is:
'Public Function ConvertReportToPDF( _
'Optional RptName As String = "", _
'Optional SnapshotName As String = "", _
'Optional OutputPDFname As String = "", _
'Optional ShowSaveFileDialog As Boolean = False, _
'Optional StartPDFViewer As Boolean = True, _
'Optional CompressionLevel As Long = 0, _
'Optional PasswordOwner As String = "", _
'Optional PasswordOpen As String = "", _
'Optional PasswordRestrictions As Long = 0 _
') As Boolean

' RptName is the name of a report contained within this MDB
' SnapshotName is the name of an existing Snapshot file
' OutputPDFname is the name you select for the output PDF file
' ShowSaveFileDialog is a boolean param to specify whether or not to display
' the standard windows File Dialog window to select an exisiting Snapshot
file
' CompressionLevel - not hooked up yet
' PasswordOwner - not hooked up yet
' PasswordOpen - not hooked up yet
' PasswordRestrictions - not hooked up yet

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
A

at

I have found this very helpful also. I have a report that is being converted
to a pdf and it works great! However, the report has 23 pages and I really
only need pages 3 and 4 to be actual pdf files. Is there a way to tell it
what pages in the report to make as a pdf file?

thanks!
at
 
J

JK

I'm getting a compile error: Method or data member not found - on
(.lstRptName) - the first one... I can't seem to figure out why... The
function works great until I try to debug my app... Any ideas? Thx.

Dim blRet As Boolean
' Call our convert function
' Please note the last param signals whether to perform
' font embedding or not. I have turned font embedding ON for this example.
blRet = ConvertReportToPDF(Me.lstRptName, vbNullString, _
Me.lstRptName.Value & ".pdf", False, True, 0, "", "", 0, 0)
' To modify the above call to force the File Save Dialog to select the name
and path
' for the saved PDF file simply change the ShowSaveFileDialog param to TRUE.
 

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