7 Replies Latest reply: May 28, 2013 10:26 PM by Michael McFarland RSS

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

Martin Junghans
Currently Being Moderated

SHORT DESCRIPTION

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)

 

 

MORE INFORMATION

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

CrystalDecisions.CrystalReports.Engine.dll

CrystalDecisions.Shared.dll

 

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?

 

 

CODE

     // init the report document works without error   

     ReportDocument reportDocument = new ReportDocument();

     reportDocument.Load(aReportTemplatePath);

reportDocument.Database.Tables[0].ApplyLogOnInfo(crLogonInfo);

 

     // 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

     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)

 

 

DEPENDENCIES

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
  • Re: CrystalReports 2008 PDF export is NOT working under IIS 7.5 / WinServer2008 R2 / 64-bit
    Ludek Uher
    Currently Being Moderated

    1) I'm still not sure what "not work" really means? E.g.; Errors, symptoms, behavior, etc.

    2) Since this works on WIn 2003 server and not WIN 2008 server, I'd blame permissions, not code. E.g.; the code should work irrespective. In particular, I find WCF apps very tricky to get going due to permissions on WIN 2008. Probably the best place to start will be with Process Monitor. See if it tells you anything.

    - Ludek

  • Re: CrystalReports 2008 PDF export is NOT working under IIS 7.5 / WinServer2008 R2 / 64-bit
    Bhushan Hyalij
    Currently Being Moderated

    Also, CR 2008 is not supposed to work with VS 2010 (.NET framework 4.0).

    Upgrade to CR for VS 2010.

    Compile and dseploy the application using CR 13 runtimes ( CR for VS 2010).

    And yes, there is not .NET SDK with CR 2011, design the report with CR 2011 designer but design the app with CR 13 assemblies.

     

    - Bhushan.

    • Re: CrystalReports 2008 PDF export is NOT working under IIS 7.5 / WinServer2008 R2 / 64-bit
      Martin Junghans
      Currently Being Moderated

      Hello Bhushan,

      thanks a lot for the reply. - I changed the 2 DLLs in my code to Version 13.0.2.469.

      1. On my developer machine the report is still created (with the new DLLs)

      2. On the server (deployment) the report is not created but I got a different exception (see below)

      Question1: What does the DB error code 17 mean (nothing found in MS SQL-Server documentation)

      Question 2: We installed CRRuntime_32bit_13_0.msi AND CRRuntime_64bit_13_0.msi on the server my application is compilled for x86 targets (32-bit) while the server OS is 64-bit: would the installation of CRRuntime_32bit_13_0.msi be sufficient in my case?

      Question 3: We installed a full version of Crystal Reports 2011 (Version 14.0) on the server as well to edit report-templates - could that lead to problems when ExportToDisk is called?

       

      Thank you for a reply,

      Martin

      The exception, thrown when ExportToDisk is called in the code:

       

      Exception: CrystalDecisions.CrystalReports.Engine.InternalException

      Message: Fehler beim Öffnen der Verbindung.

      Details:  [Datenbankanbietercode: 17 ]

      Fehler beim Öffnen der Verbindung.

      CR700_Freitextbrief {A6B97D41-5895-4FD9-B6F9-4A606256B914}.rpt

      Details:  [Datenbankanbietercode: 17 ]

      Source: CrystalDecisions.ReportAppServer.DataSetConversion

         at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)

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

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

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

         at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)

         at LfwServiceImplementation.CrystalReportCreator.SaveReport(String i_aRelativeTemplatePathAndName, KeyStringValueDTO[] i_aKeyStringValues, KeyIntValueDTO[] i_aKeyIntValues, KeyDateValueDTO[] i_aKeyDateValues, String i_aFilename)

       

      Nested Exception

       

      Exception: System.Runtime.InteropServices.COMException

      Message: Fehler beim Öffnen der Verbindung.

      Details:  [Datenbankanbietercode: 17 ]

      Fehler beim Öffnen der Verbindung.

      CR700_Freitextbrief {A6B97D41-5895-4FD9-B6F9-4A606256B914}.rpt

      Details:  [Datenbankanbietercode: 17 ]

         at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)

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

Actions