Saturday, March 24, 2012

Object reference not set to an instance of an object

Hi,
WHen i try to create to display a crystal report in the web , by making a
asp.net application.In the crystal report viewer i gave a report location,in
the data binding report source.And in the Page_Init i gave the
CrystalReportViewer1.DataBind()

..When i try to view the report in the browser i am getting the error

Object reference not set to an instance of an object

Help me out

Rny

--
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 8/19/2004The Crystal Repot Viewer treats a report just like any other object...i.e.,
you must instantiate it before you can use it. So, if you have a report
called "MyReport", try something like this:

VB:
Dim r As New MyReport;
CrystalReportViewer1.ReportSource = r
CrystalReportViewer1.DataBind()

C#:
MyReport r = new MyReport();
CrystalReportViewer1.ReportSource = r;
CrystalReportViewer1.DataBind();

Travis Murray
MCSD, MCT
Artiem Consulting, Inc.
http://www.artiem.com

"Reny J Joseph Thuthikattu" <reny@.bxtech.com> wrote in message
news:uKxydgEiEHA.2764@.TK2MSFTNGP11.phx.gbl...
> Hi,
> WHen i try to create to display a crystal report in the web , by making a
> asp.net application.In the crystal report viewer i gave a report
location,in
> the data binding report source.And in the Page_Init i gave the
> CrystalReportViewer1.DataBind()
> .When i try to view the report in the browser i am getting the error
> Object reference not set to an instance of an object
>
> Help me out
> Rny
>
> --
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.742 / Virus Database: 495 - Release Date: 8/19/2004

0 comments:

Post a Comment