cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid export DLL or export format

Former Member
0 Kudos

When trying to export a Crystal report (Crystal 2008) to an Excel file using the CrystalReportViewer control in VB.NET, I receive the error message "Error in file COVPAGE {9BC581E8-45C7-4812-A7C9-EED358F121FE}.rpt: Invalid export DLL or export format.". I am able to export the report to other file formats (PDF, Word, etc.) but cannot export to Excel.

This problem was reported under a different thread in this forum (MessageId 5920977) originally but I was asked to start a new thread on it.

I have a simple VB.NET program (VB 2005) that has a single form with a CrystalReportViewer control on it. I open an existing report in the Form_Load event and attach it to the viewer. From the UI, I select the export icon on the toolbar and select an appropriate directory and file name. I select "Microsoft Excel (97-2003) (*.xls)" in the "Save as type" combo box and press the "Save" button. This causes a message box to appear with the above error displayed.

The report is very small and only processes a single record from the database.

A suggestion was made in the other thread that a reference was needed to ExportModeller. There was some discussion about adding the reference relating to the creation of an interop assembly but no good answers to this issue were given. Currently, my test application has references to the following:

CrystalDecisions.CrystalReports.Engine (v12.0.2000.0) loaded from C:\Program Files\Business Objects\Common\4.0\managed\dotnet2\CrystalDecisions.CrystalReports.Engine.dll

CrystalDecisions.Enterprise.Framework (v12.0.1100.0 (loaded from GAC)

CrystalDecisions.Enterprise.InfoStore (v12.0.1100.0) (loaded from GAC)

CrystalDecisions.ReportSource (v12.0.2000.0) (loaded from GAC)

CrystalDecisions.Shared (v12.0.2000.0) (loaded from GAC)

CrystalDecisions.Windows.Forms v12.0.2000.0) loaded from C:\Program Files\Business Objects\Common\4.0\managed\dotnet2\CrystalDecisions.Windows.Forms.DLL

...various .NET framework dlls - all version 2.0.0.0...

The following is the code from my test application (with changes to ids/passwords, etc).

Private m_Report As ReportDocument

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

If m_Report IsNot Nothing Then

m_Report.Close()

m_Report.Dispose()

m_Report = Nothing

End If

End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

m_Report = New ReportDocument

With m_Report

.Load("C:\Relius\Admin\V14.0\Reports\COVPAGE.RPT", _

CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault)

Dim CI As New CrystalDecisions.Shared.ConnectionInfo

With CI

.ServerName = "OracleDatabase"

.DatabaseName = ""

.UserID = MyUserId"

.Password = "****"

End With

For Each Tbl As Table In m_Report.Database.Tables

Dim LI As CrystalDecisions.Shared.TableLogOnInfo

LI = Tbl.LogOnInfo

LI.ConnectionInfo = CI

Tbl.ApplyLogOnInfo(LI)

Next

.RecordSelectionFormula = "{RPTPLAN.ADMINID} = 1 AND {RPTPLAN.PLANID} = 'MYPLANID'"

'.VerifyDatabase()

End With

Me.crvViewer.ReportSource = m_Report

End Sub

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hello Ken:

First things to check:

1) you have SP 0 for CR 2008 installed?

2) you are able to export form the CR designer to Excel?

3) Download the following file:

https://smpdl.sap-ag.de/~sapidp/012002523100006252822008E/net_win_smpl.exe

The file contains sample apps. I would like you to run vbnet_win_export. To make this as easy as possible, run a saved data report so that all you have to do is run the report - without providing a database logon (you will have to accept upgrade of the assemblies to CR 12 which is what you are using).

Adding a reference to ExportModeler as per the other thread does not make sense to me as that is a simple COM dll that just loads on the click of the export button. You should not need to be adding some reference to it...

Ludek

Answers (2)

Answers (2)

Former Member
0 Kudos

Yes we had to workaround this problem a couple of months ago. The solution we have adopted is to copy the libpng10.dll into our application folder. Another solution was to add the Crystal 2008 X86 folder to the path enviornment variable.

Former Member
0 Kudos

1. I have loaded SP0 for Crystal 2008

2. I am able to export the report to Excel using the CR designer.

I saved my report with data to a temporary location using the CR designer and then went into my test application and loaded the report from there. I then removed the code to attach to a live database and when I do this, I'm able to export to Excel using the Viewer control.

I was also able to load the vbnet_win_export program from the download samples and export to excel from there.

So, it seems the problems occur when the report is being generated with access to the database? I'm using an Oracle 10g database as my data source and using the code shown in my earlier post to attach to the database. The report displays properly in the Viewer control but the error occurs when trying to export to Excel.

former_member183750
Active Contributor
0 Kudos

It's rather strange that the connection is established and a report can be viewed, but not exported. Can you add the database logon code to the vbnet_win_export app and see how that app works at that point? The code sequence would be:

Load report

Logon to the database

Export to excel

Ludek

Former Member
0 Kudos

I used the vbnet_win_export application with modifications to test. The results are the same as experienced with my test application. I load the report either with the data already loaded in the .RPT file or I load the .RPT file (without data), connect to the database, and generate the report. When loading the report with the data already saved to the .RPT file, the export works fine. When I connect to the database and attempt to export, I get the error. In either case, the Viewer displays the report without errors.

I also noted when running this application that I get the same results when exporting to "Rich Text (RTF)"

The following is the code updated in the application:

1.

' Original code loading report (embedded in the project) - Export to Excel works

crReportDocument = New Chart()

CrystalReportViewer1.ReportSource = crReportDocument

2.

' Load the report as saved to disk and including data. - Export to Excel works

crReportDocument = New ReportDocument()

crReportDocument.Load("C:\TEMP\COVPAGE.RPT")

CrystalReportViewer1.ReportSource = crReportDocument

3.

' Load the report without data and connect to the database - Export to Excel fails

crReportDocument = New ReportDocument()

crReportDocument.Load("C:\Relius\Admin\V14.0\Reports\COVPAGE.RPT")

Dim CI As New CrystalDecisions.Shared.ConnectionInfo

With CI

.ServerName = "QA140"

.DatabaseName = ""

.UserID = "SYSADM"

.Password = "SYSADM"

End With

For Each Tbl As Table In crReportDocument.Database.Tables

Dim LI As CrystalDecisions.Shared.TableLogOnInfo

LI = Tbl.LogOnInfo

LI.ConnectionInfo = CI

Tbl.ApplyLogOnInfo(LI)

Next

crReportDocument.RecordSelectionFormula = _

"{RPTPLAN.ADMINID} = 42 AND {RPTPLAN.PLANID} = 'ADVAN88'"

crReportDocument.VerifyDatabase()

CrystalReportViewer1.ReportSource = crReportDocument

former_member183750
Active Contributor
0 Kudos

Three more things:

1) You do mention this is a simple one record report. However, does the report contain any subreports?

2) Can you try an export to MS Word?

3) Try to use .VerifyDatabase after you logon to the database;

.

.

.

.

LI = Tbl.LogOnInfo

LI.ConnectionInfo = CI

Tbl.ApplyLogOnInfo(LI)

Next

m_Report.Verifydatabase

Ludek

Former Member
0 Kudos

1. There are no subreports

2. Export to MS Word works fine. Only export to Excel and export to RTF get the error.

3. I've already included VerifyDatabase in my tests. It has no impact.

Ken

former_member183750
Active Contributor
0 Kudos

This is on your development system? Sorry for the silly questions, but this just does not make sense. The export to .DOC and .RTF is essentially the same base code, with the file extension being the biggest difference...

Perhaps it's something with the report(?). Can you try with a new report, one table, one field, see how that does?

Ludek

Former Member
0 Kudos

I created a simplified report from scratch in the CR Designer. It contains one field and one table. I still get the same results. Export to Excel and RTF fail. Export to MS Word or PDF succeed.

The original report is part of a system that we've been selling commercially for years with earlier versions of Crystal. We only started seeing the problem with Crystal 2008. We are currently pre-release on our product with Crystal 2008 and this is a problem we need to address before releasing the code to our customers. We are currently working in our development/QA systems and seeing the problem there. We're seeing the problem in all other Crystal reports in our system as well. It isn't limited to a particular report. Most of the other reports are significantly more complicated, however. We chose the COVPAGE.RPT to discuss on this thread because it's the simplest report we have in our system.

former_member183750
Active Contributor
0 Kudos

Two more things to try:

1) As a test, see if changing the database driver will help. E.g.; if you are using ODBC, try OLE DB (Oracle OLE DB, not MS OLE DB), or perhaps the native CR driver for Oracle

2) Let's take a look where the app is trying to load the export dlls from. Download Filemon from here:

http://www.microsoft.com/technet/sysinternals/utilities/filemon.mspx

Here is how to use filemon:

1) Load Filemon

2) Press Ctrl + L. This will bring up the filter window.

3) In the 'include' text box, put the name of the worker process, without the full path. ie: myapp.exe (ok)

4) Click <OK>

5) Press Ctrl + X to clear the display.

6) run your application - export to excel, get it to the point where it errors.

7) Save the filemon log. File -> Save as

😎 Do a search for crxf_xls.dll. What do you see for this dll? Any fails? Not found, etc., etc? Also, do a search for exportmodeller.dll and crtslv.dll. Any messages associated with these dlls?

Ludek

Former Member
0 Kudos

Jonathan Heller came up with the answer to this problem on the other thread that I originally replied to. If we add C:Program FilesBusiness ObjectsBusinessObjects Enterprise 12.0win32_x86 to the start of our path, the correct DLLs get loaded and the problem goes away. For more details, see

I have tested this on my system and it fixes our problem as well.

Thanks to all for your efforts.

Ken

former_member183750
Active Contributor
0 Kudos

I just saw that one and another one with the same solution. I have no idea. I have already fired off an email to find out why this change in behavior and I'll update these threads when I get some info on it.

Ludek

Former Member
0 Kudos

Some additional info:

I ran SysInternals ListDLLs with a working and a non-working load of my application (based on updating the path). The following DLLs were loaded in the working program but not loaded when the export failed. Most significant of these seems to be libpng10.dll. If I move libpng10.dll to my application directory the application will work without the path addition. Moving the other files seems to have no impact on whether or not the program works. Only libpng10.dll seems to make a difference.

C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\crxf_xls.dll

C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\libpng10.dll

C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\exportmodeller.dll

C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\crheapalloc.dll

C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\crxf_xls_res_en.dll

C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\u2ddisk.dll

C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\x3ddken.dll

former_member183750
Active Contributor
0 Kudos

Ken, many thnx for the info. If I can trouble you for one more confirmation:

You are seeing this on your development system, correct? E.G.; this is not a situation where the export works on your dev system and you get the errors once you deploy using the CR MSI or MSM?

Ludek

Former Member
0 Kudos

I am seeing this in my development environment. We distribute the entire product along side our application. Our customers do custom reports of their own so they need the designer as well. We do not merely distribute runtime dlls to run the reports in our application. We sent the entire product. As such, we don't copy the Crystal dlls to our application directory. They are either loaded from the Crystal install directory or from GAC.