on 09-16-2009 3:45 PM
I am using Visual Studio .net 2008 and Crystal Reports 2008. When I try to create a PDF I get the following error:
" Error in File KPRwParm {5A952CA7-3467-481A-80CF-9CA68960BC41}.rpt: Error detected by export DLL: "
This occurs on every machine I run the report on.
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String
ToolStripStatusLabel1.Text = "Generating KPR PDF for " & Distname & " " & SchName
CreateFolder(Me.txtReportFolder.Text)
frmKPRReport.reportDocument1.SetParameterValue("My Parameter", DIST_CD)
frmKPRReport.reportDocument1.DataSourceConnections(0).SetConnection("MyDSN", "KPA", True)
myExportFile = Me.txtReportFolder.Text & Distname & "\" & "IPR09_" & SchName & ".pdf"
myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions()
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = frmRpt.reportDocument1.ExportOptions
myExportOptions.ExportDestinationOptions = myDiskFileDestinationOptions
myExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
Try
frmRpt.reportDocument1.Export(myExportOptions)
Catch
MsgBox("error for org_id: " & DIST_CD & vbCrLf & vbCrLf & Err.Description)
End Try
I have seen several other questions related but most are using excel or older versions of Visual Studio.
Edited by: MikePrater on Sep 16, 2009 4:55 PM
Hi Mike,
That error is generated if any of the values are not correct including logon info. Drop the viewer onto a forma nd try exporting from the Export button in the viewer. If anything pop's up then likely you'll need to set the same option in code. And be sure to set any options you see when done manually.
Thank you
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, now try exporting that report from Crystal Reports Designer and see what happens. Also try exporting to other formats.
It may be the export dll's are missing. Go to Add/Remove Programs and modify and expand the Export option and select all. I don't install the Lotus by default unless you plan on using it.
You may want to doing a repair install of VS 2008 also.
Also, SP2 is now available to bring you up to date.
Thank you
Don
I loaded Service Pack 2 today and that did not fix the problem. I have uninstalled and reinstalled Crystal Reports and that did not resolve the problem.
I am able to export to PDF one of my other reports that is a lot smaller. The report I am trying to export is a fairly complicated report with a bunch of sub reports. The report generates up to 64 pages and some pages are conditionally omitted.
Edited by: MikePrater on Sep 16, 2009 9:30 PM
From Crystal Reports Designer I have to deselect the Create Bookmarks from Group Tree to keep it from getting an error.
I added (CreateBookmarksFromGroupTree = False) parm to my code (see revised code)
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String
ToolStripStatusLabel1.Text = "Generating KPR PDF for " & Distname & " " & SchName
CreateFolder(Me.txtReportFolder.Text)
frmKPRReport.reportDocument1.SetParameterValue("My Parameter", DIST_CD)
frmKPRReport.reportDocument1.DataSourceConnections(0).SetConnection("MyDSN", "KPA", True)
CrystalDecisions.Shared.ExportOptions.CreatePdfFormatOptions.CreateBookmarksFromGroupTree() = False
If SchName = " " Then
myExportFile = Me.txtReportFolder.Text & Distname & "\" & "IPR09_" & Distname & ".pdf"
Else
myExportFile = Me.txtReportFolder.Text & Distname & "\" & "IPR09_" & SchName & ".pdf"
End If
myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions()
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = frmRpt.reportDocument1.ExportOptions
myExportOptions.ExportDestinationOptions = myDiskFileDestinationOptions
myExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
Dim crPDFOptions As New CrystalDecisions.Shared.PdfFormatOptions()
crPDFOptions.CreateBookmarksFromGroupTree = False
With myExportOptions
.ExportFormatOptions = crPDFOptions
End With
Try
frmRpt.reportDocument1.Export(myExportOptions)
Catch Ex As Exception
MsgBox("error for org_id: " & DIST_CD & vbCrLf & vbCrLf & Ex.Message)
End Try
If it doesn't work in the Designer it won't work in your application
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.