Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi, I've an application developed in .NET framework 3.5 in Visual studio 2008.
I've used a crystal report in one of the forms in it. The data is bound to the report dynamically. Everything works correctly when I run the application from Visual studio. However, after a setup is created using Innosetup and the application is run, the report doesn't load correctly. It just gives the following error

Exception: Load report failed.

Inner Exception: System.Runtime.InteropServices.COMException (0x80004005): Access is denied.

   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)

   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)

   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()


The code for loading the report is as follows:

C#
DataSetBillDetails details = new DataSetBillDetails();
                DataTable billDetailsDataTable = GetBillDetailsDataTable();
                details.Tables["FeeBillTable"].Merge(billDetailsDataTable);
                ReportDocument document = new ReportDocument();
                //document.Load("../../FeeBillReport.rpt");
                string strStartupPath = Application.StartupPath;
                string strReportPath = strStartupPath.Replace(@"bin\Release", "FeeBillReport.rpt");
                document.Load(strReportPath);
                document.SetDataSource((DataSet)details);
                document.DataDefinition.FormulaFields["FeeItems"].Text = "'" + billDetailsDataTable.Rows[0]["FeeItems"].ToString().Replace("\r\n", "' + chr(10) + '") + "'";
                document.DataDefinition.FormulaFields["FeeAmounts"].Text = "'" + billDetailsDataTable.Rows[0]["FeeAmounts"].ToString().Replace("\r\n", "' + chr(10) + '") + "'";
                crystalReportViewerBill.ReportSource = document;


Is there any way to deal with this error?
Posted
Comments
ZurdoDev 17-Jul-13 7:52am    
Access is denied. That is a permissions issue.
Anh Nguyen Trong 17-Jul-13 23:14pm    
@ ryanb31,

can you give the solution to this issue?

1 solution

 
Share this answer
 
Comments
Bharath Balu 7-Sep-15 2:53am    
Will that fix windows application error also?
thatraja 7-Sep-15 15:52pm    
Possibly. Try first

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



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