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

Summary at bottom of last page

3 Answers 240 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael Rogers
Top achievements
Rank 1
Michael Rogers asked on 05 Dec 2007, 12:29 AM
I have a report that has anywhere from 1 to 6 pages depending upon the amount of data. At the very last page, at the very bottom of that last page, I need to do some summary data.

I tried the footer, but that showed up at the bottom of every page. I tried group footer, but that just showed up at the end ot the group--which sometimes was at the top or middle of the page. Any thoughts of how I could accomplish this?

3 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 05 Dec 2007, 10:54 AM
Hello Michael,

Thank you for contacting Telerik Support.

You can achieve what you mentioned in the following way:

  1. Add an unbound group. You will use this group to calculate the summary automatically for you.
  2. Make the GroupHeader invisible. You will not need it.
  3. Place the TextBox(es) that will calculate the summaries in the GroupFooter and specify the appropriate item binding expression.
  4. Make the GroupFooter invisible too. It will be used to calculate the summary, but we will take the calculated value and show it in the PageFooter later.
  5. Add a PageFooter section and adjust its height appropriately.
  6. In the PageFooter section add a TextBox that will serve as means to understand whether this is the last page. The item binding expression of the TextBox should be: =(PageNumber = PageCount). Make it invisible.
  7. Add an empty TextBox to the PageFooter. This will be the TextBox that will show the summary at the last page. Set its Value to an empty string so that it cannot be seen.
  8. Attach to the GroupFooter's ItemDataBound event. It will occur when the summaries have been calculated. In this event, store the summary in a report field for later use.
  9. Now attach to the PageFooter's ItemDataBound event. In the event handler, take the Text of the box that returns whether this is the last page and coonvert to boolean. If it is the last page (the bool is true), assign the value of the report field that you filled in Step 8 to the TextBox which you added in Step 7, i.e. the summary box.
This should do the job.

I have prepared and attached a small report with all that functionality implemented. You would probably need to change the DataSource, but that is not the focus here. Take a closer look at the sample report and especially at the two event handlers. I hope that it can serve as a starting point for you and you will be able to further tailor it to suit your specific needs.

If something is not very clear or you have additional questions, do not hesitate to drop us a line.

Kind regards,
Ross
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Lester
Top achievements
Rank 1
answered on 08 Apr 2013, 04:19 PM
Hello,

I'm getting these error when I try your sample:
Error 8 'Telerik.Reporting.Processing.PageSection' does not contain a definition for 'Items' and no extension method 'Items' accepting a first argument of type 'Telerik.Reporting.Processing.PageSection' could be found (are you missing a using directive or an assembly

Error 10 Property or indexer 'Telerik.Reporting.Processing.TextBox.Text' cannot be assigned to -- it is read only 

Thanks!


0
Squall
Top achievements
Rank 1
answered on 11 Apr 2013, 12:51 PM

WOW you have reopened a forum from 2007. Just add a report footer and use aggregates.

Tags
General Discussions
Asked by
Michael Rogers
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Lester
Top achievements
Rank 1
Squall
Top achievements
Rank 1
Share this question
or