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

subreport

3 Answers 205 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ha
Top achievements
Rank 1
ha asked on 15 Oct 2008, 08:15 AM

Hello,
Report report = new Report();

DetailSection detail = new DetailSection();

report.Items.Add(detail);

for (int i = 0; i < 2; i++)

{

SubReport subReport = new SubReport();

Telerik.Reporting.

TextBox textBox = new Telerik.Reporting.TextBox();

textBox.Value = "=Berufnummer";

subReport.Report.DataSource =ds.Tables[i];

detail.Items.Add(subReport);

}

By subReport.Report.DataSource = ds.Tables[i];

getting error : Object reference not set to an instance of an object.

Any ideas.

3 Answers, 1 is accepted

Sort by
0
fruzicka
Top achievements
Rank 1
answered on 16 Oct 2008, 07:42 AM
Try this:
subReport.ReportSource.DataSource = ds.Tables[i];
this will set the datasource for subreport.
subReport.Report.DataSource will set it for parent report.

0
ha
Top achievements
Rank 1
answered on 16 Oct 2008, 10:16 AM
I have already tried, it comes the same error.
there is daten in DataSet ds, I don't understand, why comes the error?
my version is Reporting Q1 2008. please help me, thank you!
0
fruzicka
Top achievements
Rank 1
answered on 16 Oct 2008, 08:07 PM
Set breakpoint to the line, debug and see which part is not initialized.
Tags
General Discussions
Asked by
ha
Top achievements
Rank 1
Answers by
fruzicka
Top achievements
Rank 1
ha
Top achievements
Rank 1
Share this question
or