Crystal Report in Asp.net
-
Hi Dudes, Plz Solve these I am trying to implement a sample report in asp.net using crystal reports10.0. But i get an error of Object reference not set to an instance of an object Here's my code
public void btn_Click(object sender, EventArgs e)
{
frmPreview Preview = new frmPreview();
rptInformation Info = null;TableLogOnInfo logOnInfo = DBManager.getCrystalLogInfo(); //CorrectStatment Info = new rptInformation(); Info.Database.Tables\[0\].ApplyLogOnInfo(logOnInfo); //Correct formulaFieldDefs = Info.DataDefinition.FormulaFields; formulaFieldDef = formulaFieldDefs\["CompanyName"\]; formulaFieldDef.Text = "'" + Global.CompanyName + "'"; Preview.crystalRptViewer.ReportSource = Info; //Error }
Here I placed CrystalReportViewer in frmPreview
-
Hi Dudes, Plz Solve these I am trying to implement a sample report in asp.net using crystal reports10.0. But i get an error of Object reference not set to an instance of an object Here's my code
public void btn_Click(object sender, EventArgs e)
{
frmPreview Preview = new frmPreview();
rptInformation Info = null;TableLogOnInfo logOnInfo = DBManager.getCrystalLogInfo(); //CorrectStatment Info = new rptInformation(); Info.Database.Tables\[0\].ApplyLogOnInfo(logOnInfo); //Correct formulaFieldDefs = Info.DataDefinition.FormulaFields; formulaFieldDef = formulaFieldDefs\["CompanyName"\]; formulaFieldDef.Text = "'" + Global.CompanyName + "'"; Preview.crystalRptViewer.ReportSource = Info; //Error }
Here I placed CrystalReportViewer in frmPreview
It seems that you are doing this in Winforms... I think this is not the right section to post this. :mad: On this ... you didnt mentioned where exactly the error you are getting...?
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
It seems that you are doing this in Winforms... I think this is not the right section to post this. :mad: On this ... you didnt mentioned where exactly the error you are getting...?
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
I am trying to Implement in Asp.net itself. I tried in these way.. Is there any better approach I have specified the error Preview.crystalRptViewer.ReportSource = Info; //Error: Object reference is not set to an instance of an object
Did you bind the data source properly? Are you trying this in your Development environment or in Production server. Generally this sort of error comes when Crystal report is not found in the server. :confused:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript