I need to display the Group Footer which is a SubTotal of Amount , Grouped by Date only if the Month has more than 1 entry.
For example.
Date
1/1/2008 Amount: !.50
1/2/2008 4.50
Subtotal
January: 7.00
3/1/2008 Amount: 6.00
So far March, I don't want it to show the Subtotal. I have SubTotals working,
by using a Grouping field and parsing out the DateName and Month using Sql.
But I need to conditionally display the footer.
Any suggestions would be appreciated,
David
Also - Is it possible to display a Grand Total. For some reason the Page Footer does not recognize the Data Field.
For example.
Date
1/1/2008 Amount: !.50
1/2/2008 4.50
Subtotal
January: 7.00
3/1/2008 Amount: 6.00
So far March, I don't want it to show the Subtotal. I have SubTotals working,
by using a Grouping field and parsing out the DateName and Month using Sql.
But I need to conditionally display the footer.
Any suggestions would be appreciated,
David
Also - Is it possible to display a Grand Total. For some reason the Page Footer does not recognize the Data Field.
5 Answers, 1 is accepted
0
Accepted
Hello David,
You can use ItemDataBound event handler for the GroupFooter section. The code can look something like this:
Additional info can be found here "How do I modify TextBox visibility in the ItemDataBound of another TextBox?"
If you want to calculate Grand Total, place the TextBox in the ReportFooter section. Please take a look at "Understanding Report Sections" to clarify why not to use data fields in Page Header/Footer sections.
Greetings,
Hrisi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can use ItemDataBound event handler for the GroupFooter section. The code can look something like this:
private void GroupFooter_ItemDataBound(object sender, System.EventArgs e) |
{ |
Telerik.Reporting.Processing.ReportSection footerSection = (Telerik.Reporting.Processing.ReportSection)sender; |
Telerik.Reporting.Processing.TextBox groupTotal = (Telerik.Reporting.Processing.TextBox)footerSection.Items.Find("groupTotal", true)[0]; |
int count = int.Parse(groupTotal.Text); |
if (count < 10) |
{ |
footerSection.Visible = false; |
} |
} |
Additional info can be found here "How do I modify TextBox visibility in the ItemDataBound of another TextBox?"
If you want to calculate Grand Total, place the TextBox in the ReportFooter section. Please take a look at "Understanding Report Sections" to clarify why not to use data fields in Page Header/Footer sections.
Greetings,
Hrisi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

David
Top achievements
Rank 1
answered on 03 Jun 2008, 04:29 PM
This sounds good, I'm trying it, but I keep getting Index Outside the Bounds
of the Array. What does "groupTotal" represent?
Thanks,
David
Meanwhile, I'll check that link...
of the Array. What does "groupTotal" represent?
Thanks,
David
Meanwhile, I'll check that link...
0

David
Top achievements
Rank 1
answered on 03 Jun 2008, 04:51 PM
OK, I understand footerSection.Items.Find("...") represents the name of the control - however, here's the problem.
The Count is being direved from the ReportFooterSection,
The Section that needs to be invisible is the GroupFooterSection.
How can I reference the GroupFooterSection from the ReportFooterSection?
Thanks,
David
Psuedo:
[GroupFooterSection]
[ReportFooterSection] if(tbNumMonths<=1)
Processing.HidePanel(GroupFooterSection)
The Count is being direved from the ReportFooterSection,
The Section that needs to be invisible is the GroupFooterSection.
How can I reference the GroupFooterSection from the ReportFooterSection?
Thanks,
David
Psuedo:
[GroupFooterSection]
[ReportFooterSection] if(tbNumMonths<=1)
Processing.HidePanel(GroupFooterSection)
0
Hello David,
You can navigate trough Report items hierarchy using properties such as Parent, Report or Items. Every Section or Panel are container objects and you can use Items.Find to search for child items.
Note that in you scenario you have grandTotal in the ReportFooterSection. This is the most outer section in the report and it would be wrong to use the value of grandTotal, because it should always return the same value.
Best wishes,
Hrisi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can navigate trough Report items hierarchy using properties such as Parent, Report or Items. Every Section or Panel are container objects and you can use Items.Find to search for child items.
Note that in you scenario you have grandTotal in the ReportFooterSection. This is the most outer section in the report and it would be wrong to use the value of grandTotal, because it should always return the same value.
Best wishes,
Hrisi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

David
Top achievements
Rank 1
answered on 05 Jun 2008, 04:10 PM
Thank you, I managed to pass in a parameter which came from an external query which solved the problem. I then checked the Parameter's value on the Item_DataBound method of the SubTotal Group and set the visibility accordingly as per your directions below. Your answer below was most helpful. Thanks, David