This is a migrated thread and some comments may be shown as answers.

Using existing dataset

1 Answer 107 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jorge
Top achievements
Rank 1
Jorge asked on 06 Jul 2009, 01:46 PM
If I create a report using an existing dataset I get "Object reference not set to an instance of an object." when previewing. If I create a new dataset with the report wizard everything works ok.

I'm connecting the SQL Server.
Any ideas?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 09 Jul 2009, 07:34 AM
Hello Jorge,

We've not been able to reproduce such an issue on our end. Note that when you're using existing dataset not created by our report wizard, you should manually add it to the report and take care of filling it in i.e.:

 try
            {
                this.MyDataSet1TableAdapter1.Fill(this.MyDataSet1.MyDataSet1Table);
            }
            catch (System.Exception ex)
            {
                // An error has occurred while filling the data set. Please check the exception for more information.
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }

You can wire up a web/win application and hook up the report in code behind like this:

ReportViewer.Report = new MyReport();

This way you should be able to set breakpoint in the report and figure out where the problem lies.

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Jorge
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or