Problem with exprtorting a crystal report through VB
Posted on 2004-03-22
This is what I'm trying to do and what I have accomplished so far. I've created a crystal report v8.5 that uses tables from SQL. I then have VB6 code that exports the report out to PDF format. This works without a hitch. I now need to also have the report pull information from a MSAccess 2000 database. I was able to add all the needed linking and the report comes up perfectly when I preview it.
The problem is this - when I use my VB code that was previously working to try and export the report nothing gets exported. The exporting records dialogs pops up like normal but the record count doesn't move and it disapears quickly. Below I have listed the VB code. I wasn't sure if this should be posted in this section or in a VB section.
CrystalReportPath = "c:\"
ReportToWebPath = "\\saveatree\routerwatch\"
ReportToWebReport = ReportToWebPath + "Electronic Log.pdf"
Report1 = CrystalReportPath + "ELog.rpt"
Rem **** Export to Disk ****
Result = PEOpenEngine()
ReportJob = PEOpenPrintJob(Report1 & vbNullChar)
Result = PEDiscardSavedData(ReportJob)
Result = crPEExportToDisk(ReportJob, ReportToWebReport & vbNullChar, "crxf_pdf.dll" & vbNullChar, 0, 0, 0, "", "")
Result = PEStartPrintJob(ReportJob, 1)
Your help is appreciated