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

Report is not rendered fine

4 Answers 368 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matias
Top achievements
Rank 1
Matias asked on 20 May 2008, 01:46 PM
i made a business object with properties to be shown on the report.
it had all well formated strings, and collections to fill subreports.
this collections are properties.
each collection is made with the same technique, string well formated properties.

the main business object is a collection too, and has just 1 object(with collection for the subreport).

subreports datasource is provided on main report detail_ItemDataBinding like:
        private void detail_ItemDataBinding(object sender, System.EventArgs e)
        {
            Processing.DetailSection section = sender as Processing.DetailSection;
            DataRowView dRow = section.DataItem as DataRowView;
            if (dRow != null)
            {
                StaffelSubReport.ReportSource.DataSource = (StaffelRptCollection)dRow["StaffelData"];
                MateriaalSubReport.ReportSource.DataSource = (MateriaalRptCollection)dRow["Artikel_Materialen"];
                BewerkingSubReport.ReportSource.DataSource = (BewerkingRptCollection)dRow["ArtikelBewerkings"];
            }
        }


all data is correctly provided( was the first thing i have checked)
the problem is in 2 places

1st ReportViewer
report viewer is showing error when rendering subreports, each field says something like
"#ERROR# The expression contains object 'OpstelUren' that is not defined in the current context." but there is a property called like this.

Then , i tryed with ReportViewer export to pdf(this is my main specification) and the report was 100% correctly, subreport was filled perfectly. So, i look in forums and found how to export directly to pdf from code behind.
i did this with Telerik.Reporting.Processing.ReportProcessor.Render method, and HAPPENED the same with the reporViewer, showing the pdf with errors on the subreport fields.

i think there is a bug when rendering because ReporViewer shows bad on first bur exporting from this control is good, and exporting directly from the codeBehind works bad like the web rendering of the reporViewer control.

4 Answers, 1 is accepted

Sort by
0
Milen | Product Manager @DX
Telerik team
answered on 21 May 2008, 01:56 PM
Hi Matias,

Thank you for the interest in our product.

In this case it is conventional to use the NeedDataSource event of the SubReport item.
Note: The event on the item placed in the master report, not the report used as a subreport itself.

Find attached a sample project with business objects and reports that are using them as data source.
Make sure you have the DataSource of the detail report set to null, so that the NeedDataSource event is fired.

Looking at your code, it looks like the problem is that you are not setting the data to the processing reports used as subreport. Please review the help article Understanding Events for more detailed explanation.

Let us know if you need further assistance.

Kind regards,
Milen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Matias
Top achievements
Rank 1
answered on 21 May 2008, 03:46 PM
thx, finally i used that in this way. but think about naming events, because Databinding means before bind, programer knows this and uses it for almost all .net standard objects.

thanks for your reply
0
Christian
Top achievements
Rank 1
answered on 20 Apr 2010, 11:23 AM
Hi,
after the update to the current version it does not work this way. The DataItem property is unknown. How should I proceed?
Thanks.
Christian
0
Steve
Telerik team
answered on 21 Apr 2010, 07:58 AM
Hi Christian,

Take a look at the following KB article that elaborates on the matter: ReportItemBase.DataItem property (Telerik.Reporting.Processing) has been replaced by property DataObject.

Kind regards,
Steve
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Matias
Top achievements
Rank 1
Answers by
Milen | Product Manager @DX
Telerik team
Matias
Top achievements
Rank 1
Christian
Top achievements
Rank 1
Steve
Telerik team
Share this question
or