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

How to do a sub total when page break

7 Answers 416 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 20 May 2009, 09:37 AM
Hello,
I am a new user on Telerik reporting in demo for now.
I try to realize to insert in my report a line at the end of page and at the beginning of the page who make a sub total of an group who is not ended on a page.
My report is like this :
Page Header
Report Header
    First group title 
    columns titles
            Detail lines
        Second group  totals
    First group totals
Report Footer
Page Footer
When a page breaking the second group, I want this
    detail lines
    sub total line of the second group (sum of the lines before in the group)
page footer
page header
    First group header
    columns title
    sub total line of the second group (sum of the lines before in the group)
    detail lines
    
I tried this :
Page Header
Report Header
Group 1 (grouping on a  string field) 
    Header group 1                     whit the string field
    Group 2 ( no grouping)
        Header group 2 with my columns header
            Group 3 (grouping on a date field with no header)
                    Group 4 (no grouping)
                        Header group 4 (PrintOnEveryPage = true)  contains a sub total by programming -> I want this visible only if a page break occurs
                            Detail     contains a total of the precedent lines
                        Footer group 4 (PrintOnEveryPage = true)  contains a sub total by programming -> I want this visible only if a page break occurs
                Footer group 3   contains a sub total of all lines of the group 3
    Footer Group 1 contains a sub total of all lines of the group 1
Page Footer

two problems occurs : 
    - I don't see a function which can do the sum of only the detail lines before the page footer 
    - I can't render visible or not the group Header / Footer 2 because I don't know the reaon why it appears

Is this an issue of my problems ?
Is it a better way to do this ?

7 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 20 May 2009, 10:55 AM
Hi Alex,

Thank you for contacting us and your interest in Telerik Reporting.
Please note that page breaks in reports are per section only i.e. you cannot have a pagebreak somewhere in a section.
If you want to calculate Grand Total, place the TextBox in the ReportFooter section. Please take a look at "Understanding Report Sections" help article to clarify why it is not correct to use data fields in Page Header/Footer sections.
As you can see from the above article, the report header/footer and group header/footer sections work with aggregated functions and if no aggregate is specified by default, it would use First. So you can use SUM() aggregate in the group footer/header without problems and it would calculate the sum for the detail records.
As for hiding a group footer/header, you can use similar code:

 private void labelsGroupFooter_ItemDataBound(object sender, EventArgs e) 
        { 
            Telerik.Reporting.Processing.ReportSection footerSection = (Telerik.Reporting.Processing.ReportSection)sender; 
            Telerik.Reporting.Processing.TextBox groupTotal = (Telerik.Reporting.Processing.TextBox)footerSection.ChildElements.Find("groupTotal"true)[0]; 
            if (your condition here .. e.g. use groupTotal.Value) 
            { 
                footerSection.Visible = false
            }  
        } 

Hope this helps.

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Alex
Top achievements
Rank 1
answered on 20 May 2009, 02:49 PM
Hi,
I think you don't understand me. So, I show you an example of what I want to do (sample report).
Can you tell me how to do for the column 'Solde' who is the previous 'Solde' + column 'Debit' - column 'Credit' ?
And how to do for the lines 'A reporter' which are present if the page break when the group is not finish ?

with my previous post, can you tell me if the way I make my report is correct  ?

Sincerely yours,
Alex
0
Steve
Telerik team
answered on 20 May 2009, 03:22 PM
Hello Alex,

Thank you for the additional explanation. It would seem that you're trying to get sub total per page, which you can either show in current page or use for calculations on next page. Unfortunately currently we do not have page context handling functionality available i.e. you cannot show sub total for page 1 and use this total for calculation on page 2.

Please excuse us for the inconvenience.

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Alex
Top achievements
Rank 1
answered on 25 May 2009, 06:59 AM
Hi,

I want to know if it is possible to add this functionalities for respond to my needs or if it's not possible, does you think if I buy the source I can do it myself ?

Regards,
Alex

0
Steve
Telerik team
answered on 25 May 2009, 07:49 AM
Hi Alex,

We would see what we can do for such scenarios, but for the time being this would not be possible.

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sébastien
Top achievements
Rank 1
answered on 24 Nov 2009, 09:43 AM
Salut,

Est-ce maintenant possible d'utiliser le page context afin d'afficher des sous-totaux sur toutes les pages? Je dois faire un devis sous forme d'un tableau et afficher sur chaque page le sous-total des éléments du devis. A la fin du devis, je dois afficher le total.

Merci!

Hi,

Is it now possible to use page context to display subtotals on every page? I have to make a quote with a table and display on every pages the subtotal of quote items. At the end of the quote, I want display the total.

Thank's
0
Steve
Telerik team
answered on 14 Apr 2011, 03:37 PM
Hi guys,

This is a quick follow up to let you know that in Q1 2011 we've added page aggregates. For more info please refer to this blog post entry:Page Aggregates (Page Totals) in Telerik Reporting Q1 2011.

Greetings,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Alex
Top achievements
Rank 1
Answers by
Steve
Telerik team
Alex
Top achievements
Rank 1
Sébastien
Top achievements
Rank 1
Share this question
or