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

Similar Messages

  • 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

  • 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....

  • Special summary field in the group footer section.

    Post Author: Razzle00
    CA Forum: General
    I have a Crystal Report that reads a customer file grouped by custid.  In the group footer section I need to place the value of the category field from each customer record in a seperate field on the report to match the section text label.The output of the report would look something like this for each customer id (1 page per cusomter id)....
    Customer Table Example:Custid   Category  Section
    101        C         1101        B         3101        D         6101        A         2 230        B         2230        D         3 230        E         1115        A         5115        C         6
    Each page of report example output:************************************************<pageheader>
    Customer Number: 101
    <Details><groupfootersection>
    This customer has the follow for each section:
    Section 1: C  Section 2: A  Section 3: BSection 4:Section 5:Section 6: D
    <Pagefooter>************************************************
    How would I create a field that could diplay the category for each section in the groupfootersection of the report?I realize this could be done in the detail secion of the report for each record, but I do not have the optionto use the detail band.  It has to be done in the groupfootersection so that the fields can be placed in variousplaces depending on customers preference.
    Thanks,
    Razzle

    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

  • Group footer. Want to print one section in the body of report

    I am working on an invoice.
    It has two groups:
                    Detail line
                    Invoice number
    In crystal the invoice number group header is ran than the detail line group fires.
    After all the detail lines are printed for that invoice number the group footer for the invoice prints.
    I have multiple sections in my invoice number group footer.
    All these sections except the first has the property u201CPrint at Bottom of Pageu201D selected.
    The First group footer section prints as it should directly below the detail section.
    The second section print at the bottom of the page as expected.
    The third group footer does not print till the end of the entire report. So if I have multiple invoices printing at one time I see an invoice subtotal for each invoice but the u201CTotal Dueu201D does not show until the last page. It is also always 0.00.
    any help wouldbe appriciated.

    I'm guessing here, but it sounds like the data record is not "available" (past EOF?) when the footer is being printed.  Try putting the db field into a shared variable in the detail section (basic syntax):
    whileprintingrecords
    shared total as number
    total = {SOShipHeader.CuryBalDue}
    formula = ""
    Then use the shared variable in the footer:
    whileprintingrecords
    shared total as number
    formula = total
    HTH,
    Carl

  • Group Footer to be repeated on each and every page.

    hi all. i designed a crystal report with a  group on department. within department i have 20 records and hence the group is carry forwarding to next page and i get group footer on the last page of the group. but i want group footer to be on every page. i created an additional group with a formula which has code just pagenumber so that since page number changes on every page i will get group footer on every page but unfortunately i get error message. grouped on recurring value.
    please advise how to get group footer on every page.

    patrick, thanks for feedback. that solution was already implemented and was rejected by users because if a group has only one record then in the record will be displayed in details section and then users need to scroll down to page footer to see group details. there is lot of gap between details and page footer. more over there is a page break for each group. further. we have this report already done and in use sice past 10yrs in actuate 7 and we are migrating actuate reports to crystal to get rid of actuate. our users developed some application based on the report in actuate 7. now any design changes in report needs changes in actuate. hence we need group footer on everypage even if group is carryforwarded to next page.
    please advise.

  • 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

  • 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

  • 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

  • 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 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

  • 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

  • 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

  • How to display or suppress a field in the group footer conditionally

    Hi,
         I am working with crystal report XI R2
         My requirement is that suppress the filed on group footer if it is duplicating .Also display only once for the first record in  each page  if it runs in to more than one page .
    For example suppose my report is to display all the students name in a college on department basis.
    Then do the grouping on department ,then display the names  like
    Page 1
    Department                      +Student+
    Computer                             Ram
                                                    Ravi
                                                    Seetha
    Electronics                          Anvar
                                                  Deepak
                                                  Geetha
    Page 2  
    Electronics                          Hari
                                                  Karthik
                                                    Xavier
    Maths                                     Sini   etc.......
      Inorder to suppress the duplcated department name ,i am taking the count of the student names for each department and if the   count is more than 1 then suppressing it.
        But i am not able to display it conditionall on each page for the first record ,if the repor is running in different pages..
       Please let me know if you require more information regarding teh same.
    Thanks in advance,
    Smitha
    Edited by: smitha thomas on Nov 17, 2010 9:58 AM
    Edited by: smitha thomas on Nov 17, 2010 9:59 AM
    Edited by: smitha thomas on Nov 17, 2010 10:02 AM

    Right click the department name column and go to format field and  select supress if duplicate...this will remove duplicates
    to get it displayed in each page
    create a formula say F1 and place the column inside the formula
    and conditionally supress for each page
    This may help
    Thanks,
    Ganesh

Maybe you are looking for

  • How can I use my iPod Classic (6th Gen) as a voiice recorder?, How can I use my iPod Classic (6th Gen) as a voice recorder?

    I just bought an iPod Classic, and in the shop, the demo model had a "Voice Recorder" option on the menu, and I read somewhere that my ipod could be used as a voice recorder, and I was just wondering how to do this? Do I need a microphone??

  • Weird error message in Unity Connection - Email Notifications

    I went to a user, notifications, email, and put in the email address and enabled it. I click save and get this message "The specified SMTP address cannot be in the VMS domain." I searched and didn't see anything here on the forums about it and google

  • Revving Fans when left unattended... BAD!

    Randomly, but not often, when I leave my G5 Power PC tower unattended (as in, go and eat), I come back to find the fans revving at loud, full speed continuously. Consequently, the PC is frozen and unresponsive to wake from a the "sleep mode" like loc

  • Crystal Reports 8.5 export to PDF problem

    Hi Guys, I have an application developed in VB6 using a crystal reports 8.5 version and I'm having some problems to export to PDF. If I see the data on the Crystal Reports 8.5 designer It will export just fine, but if I try to do the same thing it wi

  • Slow Speeds . . . A G A I N

    Recently my speed has dropped from around 4.5mb down to 385kbs, it has happened before, and it is as though BT have put a limit on my line- why would they do this? I even got an e-mail message in my inbox the other day saying that they were now able