needDataSource calls this:
protected void shareData(object sender, EventArgs e)
{
Telerik.Reporting.Processing.ReportItemBase subreport = sender as Telerik.Reporting.Processing.ReportItemBase;
subreport.ItemDefinition.Report.DataSource = this.DataSource;
}
5 Answers, 1 is accepted
Help?
Generally the data items (subreport, table, list or crosstab) are a separate data region and does not make use of the report's data source. They have their own DataSource property which you have set in order to populate the item with data. However if you have in addition set the Report.DataSource property. The report engine will create a detail section with the data item for every row of your datasource. To avoid this behavior our suggestion is to set the Report.DataSource property to none or move the table item to another non repeating section such as report header or unbound group header (group without grouping).
Up to you last question we are not sure that we have correctly understood your inquiry thus we will appreciate if you elaborate further on your scenario.
Peter
the Telerik team
BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >
http://tv.telerik.com/watch/reporting/video/telerik-trainer-reporting-subreports uses a ReportParameter with 2 parameters, a name and a type(9:10). When I try to make one programatically, it requires 3. What is the value assigned to?
public void populateSubReport(ReportPart details, string groupby)
{
InstanceReportSource irs = new InstanceReportSource();
irs.ReportDocument = details;
report_body.ReportSource = irs;
if (groupby != null) //problem part
{
//PROBLEM
details.ReportParameters.Add(new ReportParameter(groupby, ReportParameterType.Integer, "=Fields." + groupby));
details.Filters.Add(new Filter("Fields." + groupby, FilterOperator.Equal, "=Parameters." + groupby));
report_body.ReportSource.Parameters.Add(new Parameter(groupby, "=Fields." + groupby));
}
else //this works
{
foreach (Filter f in this.Report.Filters)
{
details.Filters.Add(f);
}
}
}
Generally the ReportParameter.Value property is used to specify the default value for the parameter and you can leave it blank. Additionally the Telerik.Reporting.ReportParameter class has a default constructor. Thus if you don't want to provide a default value you can use the default constructor, initialize only the properties you need and set the Parameter.Visible property to true. In this way the report viewer will have the appropriate UI representation for the report parameter and users will be able to select the appropriate value.
Kind regards,Peter
the Telerik team
BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >