Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
OK guys, apologies if I sound lame, but, I have got to resolve this and I tried hard but now I think I need help looking at this with different set of eyes and thoughts..

Scenario:
ASP.Net application with web services (within the same domain) - C# as code behind using jQuery to call the web services.

A click of a button on the web application call a web service (within the same domain) which instructs the web service to export a crystal report to a PDF file to a directory within the same web directory (the service has permissions to write to the folder).

The web application uses windows authentication.
IIS is also configured to use windows authentication.

Problem:
When running the web application from visual studio 2010, the crystal report runs and exports the report to the required PDF file. When I host the same application on IIS 7.0, it gives me following error:

C#
System.NullReferenceException: Object reference not set to an instance of an object. 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)


When I run the crystal report in Crystal Report 2008 application, it runs successfully.

Can anyone please guide me on how to debug this one as I know the error I am getting is quite generic..

Note: There are other crystal report files connecting to a different database (other than the one with the error above) and they all export out successfully on IIS.

Any help would be greatly appreciated.

Thanks.
Posted
Comments
Garth J Lancaster 18-Jan-16 21:18pm    
You dont post any code so its a bit hard to tell - Im not an IIS/Web Wizard - the first thing I would do though, is to check that you are mapping the output path for your file correctly - using MapPath() or similar - hopefully someone else will shoot me down in flames and/or provide a better answer - in the meantime, you could update your question to show a bit more detail of the code, particularly setting up the output stream/path -> file ....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900