on 03-13-2012 7:40 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
Answers
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.
Hello Bhushan,
thank you, the problem seems to be solved now:
1. Database vendor code 17 is an access denied error
- I saw in the process monitor, that a process tried to access \\localhost\pipe\sql\...
- I had to change the server name from localhost to SERVERNAME in the DB Path
- Strange thing: the server application (.NET WCF Service) CAN access the DB with localhost
but CR 13 CANNOT access the DB with localhost (I use the same variable for the DB Path)
2. If the app targets X86, only 32 bit runtimes are sufficient.
- I can confirm this: X64 is NOT needed
3. Not sure, but ideally it should not
- Up to now, there seems to be no problems with CR13/14 installed side by side
Thanks a lot for the help!
Martin
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.