Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CrystalReports 2008 PDF export is NOT working under IIS 7.5 / WinServer2008 R2 / 64-bit


We run a server application (C# / WCF) that (among others) creates and streams PDF files based on CR templates under IIS 6.0 / WinServer2003 / 32-bit / .NET 2.0 successfully

Now we updated the server to IIS 7.5 / WinServer2008 R2 / 64-bit / .NET 4.0 (Classic Pipeline) -> the server application (WCF Service / DB access) is up and running but the PDF export from CR does NOT work anymore (details below)


We use 2 CR DLLs in the project with version 12.0.2000.683 (CR 2008)



We installed CR2008_SP4_Runtime_mlb.msi on the server (which is the latest release)

While the application is running on my developer machine from the debugger (without IIS), it does NOT work within IIS 7.5 (all the rights to C:\Windows\Temp and the CR template directories have been granted to the local IUSR on the server)

We also have CR2011 but we did NOT find the right DLLs to export reports to PDF, according to the feature list, it was only supported until CR2010 for VS – is that correct?

Is there anything wrong with my code?

Does anybody know what could cause the exception?

Do we have to add any of the missing dependent DLLs – if so how?


     // init the report document works without error   

     ReportDocument reportDocument = new ReportDocument();



     // fill all the parameter fields

     foreach(ParameterFieldDefinition def in reportDocument.DataDefinition.ParameterFields)


          // setting CR parameters works without error         

reportDocument.SetParameterValue(def.Name, i_aKeyStringValues<i>.Value);


     // throws an exception (reportDocument.Export(…) didn’t work as well)    

     reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, aDestinationFilePath);


     Exception: System.NullReferenceException

     Message: Object reference not set to an instance of an object.

     Source: CrystalDecisions.CrystalReports.Engine

at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)

at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)

        at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType)

at LfwServiceImplementation.CrystalReportCreator.SaveReport(String i_aRelativeTemplatePathAndName,

          KeyStringValueDTO[] i_aKeyStringValues, KeyIntValueDTO[] i_aKeyIntValues,

          KeyDateValueDTO[] i_aKeyDateValues, String i_aFilename)


When I check CrystalDecisions.CrystalReports.Engine.dll with the Dependency Walker:

On my developer machine, only one DLL is missing: IESHIMS.dll

On the Win2008R2 server, five DLLs are missing: IESHIMS.dll as well as

  1. MF.dll, MFPLAT.dll, MFREADWRITE.dll, WLANAPI.dll


1. Database vendor code errors are thrown by database, crystal engine displays them as it is.

Search the forums for Database vendor code 17, the issue is dicuussed before.

2. If the app targets X86, only 32 bit runtimes are sufficient.

You can also target to X64 as the server is 64 bit and install only 64 bit runtimes on server.

3. Not sure, but ideally it should not.

As you have CR 2011 designer installed on server, just as a test what happens when you open the report in the CR 2011 designer and preview it, does the report work fine?

Also, search the forums for 'Failed to open the connection', see if the articles help.

- Bhushan.

0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question