Group Footer Sum Problem

Hi Oracles!
I am using Crystal 8.5 and I am having a problem getting a SUM in a group footer. In the column I wish to add up and place in the footer has a formula field with the following:
Sum ({TicketDetail.packetsSold}, {Product.description})*{Product.costPrice}
This give me a total per line of the cost but I would like to add the lines together.
I am a novice...
Many thanks
David

Hi David,
OK got it!
Here's what you need to do:
1) Modify the formula to:
whileprintingrecords;
numbervar fin_sum;
fin_sum := fin_sum + (Sum ({TicketDetail.packetsSold}, {Product.description})*{Product.costPrice});
Sum ({TicketDetail.packetsSold}, {Product.description})*{Product.costPrice};
2) Create another formula with this code and place it in the Group footer 3 section:
whileprintingrecords;
numbervar fin_sum;
3) You then need a reset formula so that this sum adds up values only to the respective groups:
whileprintingrecords;
numbervar fin_sum := 0;
This reset formula needs to be placed on the Group Header section. I guess in this case it will be the Group header 3.
Let me know how this goes!
-Abhilash

Similar Messages

  • Problems with summary field in group footer

    Hello
    In a dynamically generated Report in c#, i made a sum in some group footer i have generated.
    the values to sum are integers. But Crystal show a result like that : 1254.00 and i want it this 1254.
    here the code use to make the sum in the group footer
    l_CrySectionSousTotal = m_ReportClientDocument.ReportDefController.ReportDefinition.get_GroupFooterArea(b_intNumGroupe).Sections[0];
    l_champsTotal.FieldFormat.NumericFormat.RoundingFormat = CrRoundingTypeEnum.crRoundingTypeRoundToUnit;
    l_champsTotal.FieldFormat.NumericFormat.NDecimalPlaces = 0;
    l_champsTotal.DataSource = "Sum ({ado.Poids})";
    m_ReportClientDocument.ReportDefController.ReportObjectController.Add(l_champsTotal, l_CrySectionSousTotal, -1);
    it's seem's like the NDecimalPlaces property do nothing.... i don't understand.
    if you have an exemple of use of NDecimalPlaces ....
    thanks for you help.

    Hello, Jonik;
    The formatting changes will not take effect unless you tell the field not to use the default values.
    So, try adding a line of code such as:
    l_champsTotal.FieldFormat.CommonFormat.EnableSystemDefault = False;
    before:
    l_champsTotal.FieldFormat.NumericFormat.RoundingFormat = CrRoundingTypeEnum.crRoundingTypeRoundToUnit;
    l_champsTotal.FieldFormat.NumericFormat.NDecimalPlaces = 0;
    Elaine

  • Suppressing a line if the sum of a value = 0 in a group footer

    How do i suppress a line if the sum of a value = 0 in a group footer
    I have tried this this formula in the section expert - Sum ({RM_INV.QUANTITY}) = 0
    will not work.

    Hi Dana, 
    The sum function needs to include the group you have your total in like: 
    Sum ({table.FIELD1}, {RM_INV.QUANTITY}) = 0
    {table.FIELD1} would be the field you are grouping on.  Your formula was summing the grand total for RM_INV.QUANTITY. 
    Thanks,
    Brian

  • Have a gap in detail of first page and not display group footer on each pag

    Please help me about Memo field in SubReport in CrystalReportXI. I have a SubReport that need to display pageheader, detail, page footer, and  in detail of subreport contains memo field and set the property of this text box to "Can Grow" = Yes .However, CrystalReportX does not support to display  pageheader, pagefooter in SubReport. So. I have created a formular FakePageHeader that has code  as
    "WhileReadingRecords;
    true"
    and group in this field and checked option repeat group header on each page and right click Section Expert->check print at Bottom of page for Group Footer.
    This problem is when I preview Subreport. It display text in group header and a gap in detail of first page and view next page, the subreport display right data of memo field. But the report still not display group footer on each page.
    How do I can remove a gap in first page and display group footer on each page?
    Thanks

    in subreport in format for the memo field uncheck keep object together.
    You can not force group footers to repeat on each page.
    I have not tried this but you might be able to capture the data you want to show in SR page footer and display in main report page footer, using shared variables.
    Ian

  • Repeat group footer on each page

    Hi all,
    I have a regular report with 1 Group. My problem is that my report doesn't repeat group footer on each page. I know that in Grouping options there is an option for "Repeat Group Header on each page" checkbox which makes the Group Header print on each page. I've found that Header and Footer both work together and that if you print Header it will print footer as well. The thing is I have paging functionality (<a href='http://www.crystalreportstrainingbootcamp.com/resources/trainers_talk_detail.asp?Title=03'>click here for paging details</a>) in my report in the Group, so once it reaches 14 lines in Details it goes to the next page, prints the GROUP HEADER but not the GROUP FOOTER on each report page.
    Does anybody know why?
    I found the following topic: <a href='http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do;jsessionid=90BF3D79A308CCF6B58F1E2656225CDD?cmd=displayKC&docType=kc&externalId=c2004981&sliceId=&dialogID=360384&stateId=1%200%20356275'>Creating a fake group header for orphaned group footers</a> but it's for CR 7. Was it resolved in newer releases of CR or it still needs a work around? I'm not even sure if that will fix my problem...
    Thank you,
    Tatyana

    Hello,
    please give us the verison of your Crystal Reports product that we can investigate
    Regards,
    Falk

  • How to get the value of a variable in group footer in the report footer also

    I have a placed a formula as below at the group footer and the report footer. The data is grouped on the basis of duedays which is again formula and the value in that is appearing correctly.
    Whilereadingrecords;
    Global Numbervar CNTONE;
    Numbervar P := P+1;
    IF P = 1 AND {@DUEDAYS} = 0
    THEN CNTONE := {spSUPPLIERSOA;1.INVOICEBAL}
    ELSE IF P>1 AND  {@DUEDAYS} = 0
    THEN CNTONE := CNTONE + {spSUPPLIERSOA;1.INVOICEBAL}
    At the group footer I get the value correctly for CNTONE but when I place the formula in Report footer I get the value for CNTONE as 0.
    Please do let me know how I could get the same value in the report footer also.
    Regards
    Sreejith J

    Hi Abhilash;
    When I give the statement whileprintingrecords then my above formula sums up only the first record and the last record of the group and when I give whilereadingrecords it adds up all the data in the group correctly.
    The formula that you mentioned for the report footer had worked out and it is showing my result correctly.
    I did not put up the reset formula on the group footer because as the group changes I had used another variable in another formula for example for the second group I used
    Whilereadingrecords;
    Global Numbervar CNTTWO;
    Numbervar Q := Q+1;
    IF Q = 1 AND {@DUEDAYS} = 30
    THEN CNTTWO := {spSUPPLIERSOA;1.INVOICEBAL}
    ELSE IF Q>1 AND  {@DUEDAYS} = 30
    THEN CNTTWO := CNTTWO + {spSUPPLIERSOA;1.INVOICEBAL}
    I have set up total 5 such formulas as the number of groups that will be formed is 5. I have put up these formulas on the group footer and suppressed it as I dont want to get it displayed.
    The as you suggested the solution for Report Footer I did that and getting the result correctly.
    I dont know I may be following a longer procedure
    Take Care
    Sreejith J

  • How do I keep together items in a group footer?

    I have a report that has a line of detail, followed by a subreport, and then another subreport all in the group footer.  The report is also formatted to be displayed in two columns.  The problem I am having is that even with the keep together checkbox selected in the group footer, often times the line of detail and the first subreport are displayed and the second subreport is shown in the second column.  They need to all move to the second column if there is not enough room in the first column for everything to be displayed.  Any ideas on how to accomplish this?
    For example:
    Information               Subreport2
    Subreport1               Information      
    Subreport2               Subreport1
    Information               Subreport2
    Subreport1
    When what I want is:
    Information               Information
    Subreport1               Subreport1
    Subreport2               Subreport2
    Information
    Subreport1
    Subreport2
    Or:
    Information               Information
    Subreport1               Subreport1
    Subreport2               Subreport2
                                     Information
                                     Subreport1
                                     Subreport2

    Hi,
    You can place the all fields in Group Footer #3
    Try to do it abhilash suggestion for Group3..
    Please go to the Group Expert > highlight the group field > options > options tab > check the 'keep group together' option.
    Please update the status
    Thanks,
    DJ

  • How to suppress page header when rendering particular group footer

    Description:  I am using Crystal Reports 2008.  I have a report with a page header, and several groupings.  The groups all suppress their headers, but have footers.  The grouping is in the order:  type,county,city,status,parent.  The first 3 footers force a new page before the footer.  The county footer includes summaries and charts.
    Problem:  The client wants the header displayed for the detail and the header for the county footer to be different.  How can I make this happen?
    More Info:  I currently have just a page header.  I have tried messing with the suppress formula for the page header, but I cannot figure out the correct formula to use to suppress the page header on a county footer page.  Is there a way to do this, or is there a completely different approach I should be taking to solve this? 
    I can provide more info if needed.
    Google search was unhelpful in solving this problem.  This problem is driving me nuts.  Any help appreciated.
    Thanks,
    Michael

    What i would suggest is to create a new variable in WhilePrintingRecords evaluation time. For example:
    1. Boolean variable set to TRUE in Group Footer #2 (County)
    2. Reset it to FALSE in Group Header #2 and Group Footer#1
    3. Use the variable for conditional suppression

  • Report Builder Group Footer Bug?

    Data contained in a group footer does not print on a new page
    when the group footer is the only section left to fill on the
    current page. This is a serious problem when you embed a subreport
    in a group footer because the subreport also fills on the same
    column and overwrites the existing information instead of forcing a
    new page.
    Am I the only one experiencing this? Any suggestions?
    Here is an example: Notice the data overwritten in the upper
    right column. The footer info should have forced a new page.
    Group
    footer problem example

    Try using the Properties Panel - Elements selector to select
    the hidden text fields. You should be able to delete them once they
    are selected.

  • Group Number in Group footer

    Hi,
    I want to display group number in the footer of group in SSRS(this task needs to be done in report but not in sql).How can we accomlish this.
    Ex:If report is  grouped by state
    PA(GroupHeader)
      Detail row
    GroupFooter(1)
    NJ(GroupHeader)
     Detail row
    GroupFooter(2)
    i.e for PA group in footer it should display 1.
    for 2 nd group display 2 and so on.q

    Hi,
    Modify the code as below, 
    shared dim Categories as new collection
    shared Counter as integer=0
    public function getGroupCounter(Item as String) as String
    if Categories.contains(Item) then return "Group Footer " & Categories(Item).tostring()
    Counter=Counter+1
    Categories.add(Counter,Item)
    return "Group Footer " & Counter.tostring()
    end function
    Then modify the expression that calls the code. You have to pass parameter that makes it unique througout your report. You may need to concatenate all the values of the group levels from 7 to 2 to achieve this like shown below.
    =Code.getGroupCounter(Fields!Field1.Value & Fields!Field2.Value & Fields!Field3.Value)
    Replace Field1, Field2 etc with the Field names you used in the group by while creating the groups.
    Please feel free to discuss any further questions.
    Regards
    Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful. BH

  • Dynamic Picture Displaying in the Group Footer Section

    Hi all,
    I am building a sales quotation layout for SBO in crystal 2008.
    The layout has only one group. The first line in each group in considered to be a slaes tree father.
    For every group i need to display the picture of the "father" in the group footer  (one picture for every group).
    I get up to the stage when for each line in the detailes section i have a picture, but for all the lines other then the "father" line the picture is supressed.
    My problem is moving the displayed fahter picture from the detailes section to the group footer section. Every time i copy the picture field to the group footer nothing is displayed.
    Any idea?
    Thanks,
    Udi

    A group footer will dis[lay contents of the last record. You need to sort records to ensure that the last record contains link to your dynamic image.
    Ian

  • How to show the total in group footer in group header?

    Hello,
    I am having difficulties while showing the total of a group footer in the group header. The total in the group footer is correct, but when i am placing the formula in the header it is giving me 0.
    I am having 2 formulas to get the total which i placed in the footer:
    1.
    whileprintingrecords;
    numbervar sumpctx := sumpctx + {@Sum OB};
    2.
    whileprintingrecords;
    global numbervar sumpctx;
    numbervar DispSales;
    DispSales := sumpctx;
    sumpctx := 0;
    DispSales;
    now, I want to add the 2 formula in the header, but it is giving me 0 value, But in the group footer it is showing the correct value.
    I tried to do:
    Sum ({@Sum OB}) and it is giving that the field can not be summarized.
    The group Name is @Entity which is grouped by.
    @Entity :
    if {Customer.NAME}="NONE" THEN
    " OB"
    ELSE {Customer.NAME}
    Thanks in advance for yopur help.
    Regards

    Hi,
    What i was trying to say there is a hierarchy in report design and records are processed in that way.
    Report header/footer - only once
    Page header/footer -once in a page
    detail -n no of times ,n-no of rows of data
    First report header will be processed,then page header n detail,after that report and page footer.
    If u insert a group,then the order will be-
    report header,page header,group header,detail,group footer,detail,report and page footer.
    When u r in group header,all the records are not processed,that results the sum as zero.
    But when u create a formula,it calculates the sum first and then u put it there.
    I hope this time it will be helpful for u.
    Regards,
    Misra P.

  • Previous record values displaying in the Group Footer row in the report.

    Hi Friends,
    I have 3 tables
    TableA:(PERNR BEGDA ENDDA are key fields)
    PERNR BEGDA    ENDDA      WERKS
    10001 1/1/2010 12/31/9999 1001
    TableB:(PERNR BEGDA ENDDA SUBTY are key fields)
    PERNR BEGDA    ENDDA       SUBTY  TYPES
    10001 1/1/2010 12/31/9999   01          COMS1
    10001 1/1/2010 12/31/9999   02         COMS2
    TableC:(PERNR BEGDA  ENDDA are key fields)
    PERNR BEGDA  ENDDA        AMNT
    10001 2/2/1997 4/3/2010      1000
    10001 4/4/2010 12/31/9999  2000
    I have joined these table by the key 'PERNR'( like A->B and A->C)
    Groped by the same key 'PERNR'
    My result rows in the report:
    PERNR BEGDA    ENDDA      WERKS  SUBTY  TYPES  BEGDA    ENDDA      AMNT
    10001 1/1/2010 12/31/9999 1001       01         COMS1  2/2/1997 4/3/2010    1000
    10001 1/1/2010 12/31/9999 1001       02         COMS2  2/2/1997 4/3/2010    1000
    10001 1/1/2010 12/31/9999 1001       01         COMS1  4/4/2010 12/31/9999 2000
    10001 1/1/2010 12/31/9999 1001       02         COMS2  4/4/2010 12/31/9999 2000
    But in the report format is like this in the Group Footer row:
    PERNR: 10001                     WERKS:1001
    SUBTY: 02                          AMNT :2000 (Current date)
                                                AMNT :1000 (Previous record)
    I created the format with "Previous" function
    but in the report it is giving the '2000' instead of '1000' in the AMT field
    Please help me, can i use the for loop in the report? or any sugessions?
    Thanks in advance.
    Regards,
    Venkata

    A group footer will dis[lay contents of the last record. You need to sort records to ensure that the last record contains link to your dynamic image.
    Ian

  • Repeat group header on every page before group footer as group spans across

    I have a group which spans across multiple pages.In group there are two subreports in Group footer.I have set all the required parameters to repeat group header on every page in group expert,but not getting desired results,please help....

    I have following structure in my report.
    I have two group headers at the top,first one contains name of the site & site number,second header contains Site-Admin as heading,below which i have kept details section of report which displays name of administrator which repeats details section in case there are more than one adminstrators.
    Below this i have two group footers which individually contain each of the two sub-reports.
    As per data,these individual subreport may or may not begin at the beginning of the new page every
    time,therefore fake group header put at the beginning of these sub-reports may come in middle of the page sometime,so thet cant be done.
    Thank you,please reply if you have another solution....

  • How to suppress page header when group footer prints

    I would like to suppress the page header on my report when a group footer prints.  My group footer is going to be a bunch of legal mumbo jumbo and I'm going to have it do a page break before so it prints on it's own page.  I do not want my page header info printing on this page.
    Is there a way to do this?  I am on Crystal XI.  Thank you in advance.

    I haven't tested this, but...
    Formula @InGroupHeader:
    WhilePrintingRecords;
    BooleanVar InGroupFooter;
    InGroupFooter = False;
    Formula @InGroupFooter:
    WhilePrintingRecords;
    BooleanVar InGroupFooter;
    InGroupFooter = True;
    PageHeader.Suppress:
    WhilePrintingRecords;
    BooleanVar InGroupFooter;
    InGroupFooter;
    Edit: I think I like Graham's solution better, actually.
    Edited by: Garrett Fitzgerald on Jun 15, 2009 12:12 PM

Maybe you are looking for