i have created the report in the run time but i have not able to create the group and sum
so i want to know How to create the report in run time with group and sum.
if possible please provide some sample code
it will highly appriciated
Thanks in advance
Mahendra
1 Answer, 1 is accepted
0
Peter
Telerik team
answered on 22 Feb 2011, 12:06 PM
Hi Mahendra,
We highly recommend creating the desired groups through the Report Designer first and then review the code in the InitializeComponent() to see the internal structure. Check out the following code snippet that shows in general how to add groups programmatically. We are not sure about your specific scenario, thus this is just a sample code:
var group1 = new Telerik.Reporting.Group();
var groupFooterSection1 = new Telerik.Reporting.GroupFooterSection();
var groupHeaderSection1 = new Telerik.Reporting.GroupHeaderSection();
var textBox1 = new Telerik.Reporting.TextBox();
//
// group1
//
group1.GroupFooter = groupFooterSection1;
group1.GroupHeader = groupHeaderSection1;
group1.Groupings.Add("=Fields.Manufacturer");
group1.Name = "group1";
//
// groupHeaderSection1
//
groupHeaderSection1.Height = new Telerik.Reporting.Drawing.Unit(0.7D, Telerik.Reporting.Drawing.UnitType.Inch);
groupHeaderSection1.Name = "groupHeaderSection1";
//
// textBox1
//
textBox1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(4D), Telerik.Reporting.Drawing.Unit.Inch(0.2D));
textBox1.Name = "textBox1";
textBox1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(1.8D), Telerik.Reporting.Drawing.Unit.Inch(0.2D));