Crystal Reports: Load report failed error.

S

Simon

Hi

I try to open a CR report file located on the network path from a web form
developed with vs2003 and CR for Visual Studio, but the Load method of
ReportDocument object always return error.

---------------------
Load report failed.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details:
CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Load report
failed.

Source Error:

Line 32: oRpt.Load( "\\\\server\\dir\\report.rpt");

Source File: c:\inetpub\wwwroot\crtest\webform1.aspx.cs Line: 32

Stack Trace:

[LoadSaveReportException: Load report failed.]
.I(String , EngineExceptionErrorID )
.E(String , Int32 )
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String
reportName, OpenReportMethod openMethod, Int16 parentJob)
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String
reportName)
crtest.WebForm1.Page_Load(Object sender, EventArgs evt) in
c:\inetpub\wwwroot\crtest\webform1.aspx.cs:32
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()


----------


I have tryed to use impersonating setting the web.config file but I still
have a problem.
If I copy locally the CR report file and try to open it the web application
work fine, I try also to open file using FileStream and work.

sample code:

// this work
FileStream fs = new FileStream( "\\\\server\\dir\\report.rpt",
FileMode.Open, FileAccess.Read );
fs.Close();

ReportDocument oRpt = new ReportDocument();

// this generate error
oRpt.Load( "\\\\server\\dir\\report.rpt");

// this work
oRpt.Load( "c:\\Temp\\report.rpt");

CrystalReportViewer1.ReportSource = oRpt;

Some suggestion ?

Thanks in advance

Simon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top