Object reference not set to an instance of an object

  • Thread starter Reny J Joseph Thuthikattu
  • Start date
R

Reny J Joseph Thuthikattu

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
 
T

Travis Murray

The 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
 

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

Top