Cyrstal report subreport problem
I'm developing a report within my C# windows app. I'm using a subreport within the details section of my main report. While running the report from the project window(VS.Net IDE) it works fine. However if I try to run the exe directly (or after installing the application setup), it gives me error as follows,
Object reference not set to an instance of an object. (title of error message: Crystal Report Windows Forms Viewer).
Here is the code which i'm using
ReportDocument objDoc = new ReportDocument ();
objDoc.Load (Application.StartupPath + @"rptTest.rpt");
objDoc.SetDataSource (datasetName);
crystalReportViewer1.ReportSource = objDoc;
My doubt is I have not mentioned about the subreport in the code. So I suspect about that. Can anybody give me idea about using subreport with in a report?
I tried with a test report without using subreport, it works just fine. I would like to request you all to suggest me a solution for this.
Thanks and regards,
Keshav.
|