| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |
|

11-13-10, 15:34
|
|
Registered User
|
|
Join Date: May 2006
Posts: 352
|
|
|
|
Anyone can help on this please? I am stuck on this.
Any help would be much apprecited.
__________________
Emi-UK
Love begets Love, Help Begets Help
|
|

11-13-10, 15:43
|
|
Registered User
|
|
Join Date: May 2006
Posts: 352
|
|
I am really in need of help. Any help would be highly appreciated on this.
__________________
Emi-UK
Love begets Love, Help Begets Help
|
|

11-13-10, 15:49
|
|
Registered User
|
|
Join Date: Mar 2009
Posts: 3,446
|
|
|
|
Quote:
Originally Posted by Emal
Please note that Booking7 is the name my report which I would like to convert to PDF and automatically appear as an email attachment with some alreay starndard written text and subject on the email.
|
If Booking7 is the name of the report you cannot use Me.Booking7 in this case. Me.Booking7 would mean that Booking7 is the name of a control in the form controls collection from where the code is executed.
__________________
Have a nice day!
|
|

11-13-10, 15:52
|
|
Registered User
|
|
Join Date: May 2006
Posts: 352
|
|
HI Sinndho,
Thank you very much for your swift reponse, tehn can you please help me how to get this fixed, my boss has been pressurising me on fixing this but I simply could not figure this out. Thank you so much.
__________________
Emi-UK
Love begets Love, Help Begets Help
|
|

11-13-10, 15:57
|
|
Registered User
|
|
Join Date: Mar 2009
Posts: 3,446
|
|
What's the syntax of the method (function) you use for converting a report to a .pdf file?
__________________
Have a nice day!
|
|

11-13-10, 16:09
|
|
Registered User
|
|
Join Date: May 2006
Posts: 352
|
|
Thank you.
Following is the code that Rogue had sent me a link for, as you can see from below only a few lines are active the rests are notes for further information.
Quote:
Private Sub cmdReportToPDF_Click()
' Save the Report as a PDF document.
' The selected report is first exported to Snapshot format.
' The Snapshot file is then broken out into its
' component Enhanced Metafiles(EMF), one for each page of the report.
' Finally, the EMF's are converted to PDF pages within the master
' PDF document.
' 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 = 150, _
'Optional PasswordOpen As String = "", _
'Optional PasswordOwner As String = "", _
'Optional PasswordRestrictions As Long = 0, _
'Optional PDFNoFontEmbedding as Long = 0, _
'Optional PDFUnicodeFlags 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 - Resolution in DPI(Dots per Inch) to apply to embedded Images
' PasswordOpen - Users require to Open PDF
' PasswordOwner - Users require to modify PDF
' PasswordRestrictions - Restrictions for viewing/editing/printing PDF - See modReportToPDF for comments
' PDFNoFontEmbedding - Do not Embed fonts in PDF. Set to 1 to stop the
' default process of embedding all fonts in the output PDF. If you are
' using ONLY - any of the standard Windows fonts
' using ONLY - any of the standard 14 Fonts natively supported by the PDF spec
'The 14 Standard Fonts
'All version of Adobe's Acrobat support 14 standard fonts. These fonts are always available
'independent whether they're embedded or not.
'Family name PostScript name Style
'Courier Courier fsNone
'Courier Courier-Bold fsBold
'Courier Courier-Oblique fsItalic
'Courier Courier-BoldOblique fsBold + fsItalic
'Helvetica Helvetica fsNone
'Helvetica Helvetica-Bold fsBold
'Helvetica Helvetica-Oblique fsItalic
'Helvetica Helvetica-BoldOblique fsBold + fsItalic
'Times Times-Roman fsNone
'Times Times-Bold fsBold
'Times Times-Italic fsItalic
'Times Times-BoldItalic fsBold + fsItalic
'Symbol Symbol fsNone, other styles are emulated only
'ZapfDingbats ZapfDingbats fsNone, other styles are emulated only
' PDFUnicodeFlags controls how each metafile text record is interpreted in terms
' of Unicode and BiDi language. See modDocumentor for details.
'
' You must pass either RptName or SnapshotName or set the ShowSaveFileDialog param to TRUE.
' Any file names you pass to this function must include the full path. If you only include the
' filename for the output PDF then your document will be saved to your My Documents folder.
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.Booking7, vbNullString, _
Me.Booking7.Value & ".pdf", False, True, 150, "", "", 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.
End Sub
|
__________________
Emi-UK
Love begets Love, Help Begets Help
|
|

11-13-10, 16:37
|
|
Registered User
|
|
Join Date: Mar 2009
Posts: 3,446
|
|
Then it should be something like:
Code:
If ConvertReportToPDF("Booking7",, "Booking7.pdf") = True Then
' Send pdf document
Else
' error handler
End If
This will create a document named "Booking7.pdf" from the existing report "Booking7".
Generally speaking, you can omit the optional parameters if you're satisfied with their default values.
__________________
Have a nice day!
|
|

11-13-10, 16:46
|
|
Registered User
|
|
Join Date: May 2006
Posts: 352
|
|
Does it mean that the whole code should be somethin like this, if so, then I am not sure why the code breask on the very first line:
The code also breaks on ConvertReportToPDF giving this error
Quote:
|
Compile Error, sub or function not defined
|
Quote:
Private Sub cmdReportToPDF_Click()
If ConvertReportToPDF("Booking7", , "Booking7.pdf") = True Then
' Send pdf document
Else
' error handler
End If
Dim blRet As Boolean
blRet = ConvertReportToPDF(Me.Booking7, vbNullString, _
Me.Booking7.Value & ".pdf", False, True, 150, "", "", 0, 0, 0)
End Sub
|
__________________
Emi-UK
Love begets Love, Help Begets Help
|
|

11-13-10, 16:59
|
|
Registered User
|
|
Join Date: May 2006
Posts: 352
|
|
I thought, it might help. I have attached a screenshot of the code used for this.
__________________
Emi-UK
Love begets Love, Help Begets Help
|
|

11-13-10, 17:02
|
|
Registered User
|
|
Join Date: Mar 2009
Posts: 3,446
|
|
Do you have a command button control named cmdReportToPDF on the form from where the code is executed, and to you yave a reference to the library containing the ConvertReportToPDF function in your project?
__________________
Have a nice day!
|
|

11-13-10, 17:14
|
|
Registered User
|
|
Join Date: May 2006
Posts: 352
|
|
good question, I do have a control named cmdreportToPDF on the form but there is no reference to the library containing teh ConvertReportPDF under tools, reference. I also tried to brows through the system32 folder but nothing called ConvertReportPDF. I was wondering whether another PDF driver could be used. For manual converting I currently used DeskPDF software. Thank you for much for your continued support.
__________________
Emi-UK
Love begets Love, Help Begets Help
|
|

11-13-10, 17:50
|
|
Registered User
|
|
Join Date: Mar 2009
Posts: 3,446
|
|
Then download and install the dll from: ReportToPDF
__________________
Have a nice day!
|
|

11-13-10, 17:58
|
|
Registered User
|
|
Join Date: May 2006
Posts: 352
|
|
I have already installed and saved the two dll files in windows/system32 folder but I still get the same issue. Just to clarify, I installed the first link on the page (the latestedone in zipped folder and I then copied and pasted it in system32 folder.
__________________
Emi-UK
Love begets Love, Help Begets Help
|
|

11-13-10, 18:50
|
|
Registered User
|
|
Join Date: Mar 2009
Posts: 3,446
|
|
Have a look at the contents of the READMEFIRST Form in the A2000SnapshotToPDFver785.mdb database, everything is explained in detail.
You need to import the module modReportToPDF from the A2000SnapshotToPDFver785.mdb database into your own. Then you need to edit it and replace the path to the .dll files in each Declare statement, ex.:
Code:
... Lib "C:\VisualCsource\Debug\StrStorage.dll"...
If you copied the dlls into the C:\windows\system32 forder, it mus become (be careful, case is significant):
Code:
... Lib "C:\WINDOWS\system32\StrStorage.dll"...
It should then work as expected.
__________________
Have a nice day!
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|