Hello saravana,
As of R3 2016, changes in the report template cannot be applied in report events -
R3 2016 Upgrade Path. You can create an instance of the report and modify it before displaying it in a viewer.
For example:
var reportInstance =
new
MyVSReport();
//or you can get a Telerik.Reporting.Report object here
//get a section or item you want to modify
var detail = reportInstance.items.Find(
"detail"
,
true
)[0]
as
Telerik.Reporting.DetailSection;
//generate items dynamically
Telerik.Reporting.Panel panel1 =
new
Telerik.Reporting.Panel();
Telerik.Reporting.TextBox textBox1 =
new
Telerik.Reporting.TextBox();
// panel1
panel1.Location =
new
Telerik.Reporting.Drawing.PointU(
new
Telerik.Reporting.Drawing.Unit(1.0, Telerik.Reporting.Drawing.UnitType.Cm),
new
Telerik.Reporting.Drawing.Unit(1.0, Telerik.Reporting.Drawing.UnitType.Cm));
panel1.Size =
new
Telerik.Reporting.Drawing.SizeU(
new
Telerik.Reporting.Drawing.Unit(8.5, Telerik.Reporting.Drawing.UnitType.Cm),
new
Telerik.Reporting.Drawing.Unit(3.5, Telerik.Reporting.Drawing.UnitType.Cm));
panel1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid;
// textBox1
textBox1.Location =
new
Telerik.Reporting.Drawing.PointU(
new
Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Cm),
new
Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Cm));
textBox1.Name =
"NameDataTextBox"
;
textBox1.Size =
new
Telerik.Reporting.Drawing.SizeU(
new
Telerik.Reporting.Drawing.Unit(5.0, Telerik.Reporting.Drawing.UnitType.Cm),
new
Telerik.Reporting.Drawing.Unit(0.6, Telerik.Reporting.Drawing.UnitType.Cm));
textBox1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid;
textBox1.StyleName =
"Data"
;
textBox1.Value =
"=Fields.CustomerID"
;
panel1.Items.AddRange(
new
Telerik.Reporting.ReportItemBase[] {textBox1});
detail.Items.AddRange(
new
Telerik.Reporting.ReportItemBase[] {panel1});
//display the modified report
var IRS = ne w InstanceReportSource {ReportDocument = reportInstance};
reportViewer1.ReportSource = IRS;
I hope this helps.
Regards,
Stef
Telerik by Progress
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 Feedback Portal
and vote to affect the priority of the items