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

Show GroupFooterSection using code

1 Answer 31 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chetan Pawar
Top achievements
Rank 1
Chetan Pawar asked on 18 Nov 2009, 05:35 AM
Hi All,
I am binding a report to viewer using code at run time.
report details and header are displaying well.
I want to show sum/count summary information of all columns within report in  "GroupFooterSection".
I have written following code
Telerik.Reporting.ReportItemBase[] reportitmfooter = new ReportItemBase[ds.Tables[0].Columns.Count]; 
for (int i = 0; i < ds.Tables[0].Columns.Count; i++) 
 { 
//Fill the Group footer for show sum or count 
            Telerik.Reporting.TextBox txtGroupFooter = new Telerik.Reporting.TextBox(); 
            txtGroupFooter.Value = "=count([" + headcolumnname + "])"; 
            txtGroupFooter.Name = "Sum" + headcolumnname; 
            //textBoxDetails.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(xaxis, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(yaxis, Telerik.Reporting.Drawing.UnitType.Inch)); 
            textBoxDetails.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.5, Telerik.Reporting.Drawing.UnitType.Cm)); 
            reportitmfooter[i] = txtGroupFooter; 
 
                  
 
 
//group footer 
        Telerik.Reporting.GroupFooterSection groupFootersection = new GroupFooterSection(); 
        groupFootersection.Height = new Telerik.Reporting.Drawing.Unit(0.2, Telerik.Reporting.Drawing.UnitType.Inch); 
        groupFootersection.Style.BackgroundColor = System.Drawing.Color.Blue; 
        groupFootersection.KeepTogether = true
        groupFootersection.Visible = true
        groupFootersection.Name = "rptGroupFooter"
         
        groupFootersection.Items.AddRange(reportitmfooter); 
        report.Items.Add(groupFootersection); 

Group Footer is not displaying on web.
Please provide help.

Thank you in advanced.

1 Answer, 1 is accepted

Sort by
0
Accepted
Milen
Telerik team
answered on 18 Nov 2009, 03:45 PM
Hi Chetan Pawar,

If you really need to dynamically add the TextBox items in the group footer "by hand", the best teacher is still the report designer - add some items in the footer and review the generated code in the InitializeComponent method. Keep in mind that you need to provide appropriate location for each item, so that they do not overlap.

Write us if you need further assistance.
 

Kind regards,
Milen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Chetan Pawar
Top achievements
Rank 1
Answers by
Milen
Telerik team
Share this question
or