cancel
Showing results for 
Search instead for 
Did you mean: 

Error detected by export DLL creating PDF with VS .net 2008/CR 2008

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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

Former Member
0 Kudos

I get the same error when I export to PDF from a report viewer form.

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

Hi Mike,

Nice find... I suggest you post a question to the Report Design forum and ask why the report fails with that option checked. It may be a bug or they may suggest a better way to optimize your report for exporting.

Thanks again

Don

Former Member
0 Kudos

I will post to the Report Design forum. Unfortunately that still doesnt resolve my problem in .net Even when I set the CreateBookmarksFromGroupTree = False in my program I get the same error. Unless there is something wrong with my code that does not set the parm correctly.

Answers (1)

Answers (1)

0 Kudos

If it doesn't work in the Designer it won't work in your application