VENKATGVR
asked on
Exporting Crystal Report 8.5 file to PDF using VB6 Coding
When I export Crystal Report 8.5 File to PDF file through VB6 code export is successful but cannot open the PDF file.
Error: File does not begin with '%PDF-'.
If I export the same report file directly from crystal reports to PDF then I can open the PDF file.
Error: File does not begin with '%PDF-'.
If I export the same report file directly from crystal reports to PDF then I can open the PDF file.
ASKER
Hi Jhance,
Here is my code.
CRPT.Destination = crptToFile
CRPT.PrintFileName = "C:\Analysis\Rpt001.PDF"
CRPT.PrintFileType = crptCSV
CRPT.Action = 2
The Crystal version I am using is 8.5 and the PDF version is 5.0.
The file Rpt001.pdf is created but Error: File does not begin with '%PDF-'.
Thanks.
Here is my code.
CRPT.Destination = crptToFile
CRPT.PrintFileName = "C:\Analysis\Rpt001.PDF"
CRPT.PrintFileType = crptCSV
CRPT.Action = 2
The Crystal version I am using is 8.5 and the PDF version is 5.0.
The file Rpt001.pdf is created but Error: File does not begin with '%PDF-'.
Thanks.
>>>CRPT.PrintFileType = crptCSV
That's asking for a CSV file, NOT a PDF. How about trying:
CRPT.PrintFileType = crptPDF
instead?
That's asking for a CSV file, NOT a PDF. How about trying:
CRPT.PrintFileType = crptPDF
instead?
ASKER
Jhance,
I tried with CRPT.PrintFileType = crptPDF, it gives error....!
I tried with CRPT.PrintFileType = crptPDF, it gives error....!
What error?
Try this program, which used Craxdrt control
dim crapp as craxdrt.application
dim crRpt as craxdrt.report
set crRpt = crapp.openreport("your reportname")
crRpt.exportoptions.format type=crEFT PortableDo cFormat
crRpt.Exportoptions.Destin ationType= crEDTDiskF ile
crRpt.Exportoptions.DiskFi leName = "pdf Filename with path"
CrRpt.Export False
You have to add reference to CRAXDRT dll in your project
dim crapp as craxdrt.application
dim crRpt as craxdrt.report
set crRpt = crapp.openreport("your reportname")
crRpt.exportoptions.format
crRpt.Exportoptions.Destin
crRpt.Exportoptions.DiskFi
CrRpt.Export False
You have to add reference to CRAXDRT dll in your project
Try this....
Disable the "Display PDF in Browser" option in your reader software.
Use Start - Programs - Adobe Reader to run the program directly (instead of embedded inside the web browser).
Pull down the Edit menu and choose Preferences.
In the Internet settings page, de-select (uncheck) the "Display PDF in Browser" option.
Disable the "Display PDF in Browser" option in your reader software.
Use Start - Programs - Adobe Reader to run the program directly (instead of embedded inside the web browser).
Pull down the Edit menu and choose Preferences.
In the Internet settings page, de-select (uncheck) the "Display PDF in Browser" option.
ASKER
Hi Chandu,
To declare as craxdrt.application what Reference I should add in VB project..
To declare as craxdrt.application what Reference I should add in VB project..
ASKER
Hi Assyst,
I did as what you said but still I get the same error.
I did as what you said but still I get the same error.
Whats your Adobe reader version.
Please try installing Adobe Reader 7
And try opening the file after exporting from crystal report.
Please try installing Adobe Reader 7
And try opening the file after exporting from crystal report.
ASKER
ThanQ..!
Right now I am using version 5.
I'll install version 7 and test.
ASKER
Assyst,
I installed Version 7, but still says file is currepted when I open the exported file.
I installed Version 7, but still says file is currepted when I open the exported file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Chandu,
ThanQ..!
I'll do that and let you know.
%PDF-1.3
or similar. The "1.3" represents the PDF version used and that may change.
It sounds like you're doing something wrong. Why don't you post the code you are using as it might be easier to find your mistake.