Using Group Footer Level Totals In A Calculation

I have a Crystal Reports (Version 8) that has a count of records at the 'Group Footer' level.  I need to capture thre group counts for a calculation  I getting the correct count, but can't capture the value for each group footer level to subtract in a fromula.
Group Level   For 'A'  78
Group Level   For 'B'  50
Group Level   For 'C'  25
Group Level   For 'D'  30
I want to add 'A'', 'B', and 'D' and subtract 'C'.  In other words  (78 + 50 + 30 = 158)
It appears that the group footer totals are cleared when there is a group break.  Can someone give me an idea (sample code) on how to do this ?

Hi
In order to get the required results follow the steps :
Create a formula and place in your detail :
Whileprintingrecords;
Numbervar cnt;
If Groupname(Yourgroup) =  "Unassigned"  or Groupname(Yourgroup) = "Unknown" Then
cnt=cnt-1
else
cnt=cnt+1
Now create another formula and place in your report footer to get toal :
Whileprintingrecords;
Numbervar cnt;
This will give you total excluding your "Unassigned"  and  "Unknown" .
Thanks,
Sastry

Similar Messages

  • Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group.

    Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group. Through this memberof class I am trying to find full qualified name(DN) of my group.
    code I have used:
    //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "";
    Also I have used,
                 String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "ou=ibmgroups,o=ibm.com";
    But in both cases I am getting value for Total groups as 0.
    Code Reference:
    * memberof.java
    * December 2004
    * Sample JNDI application to determine what groups a user belongs to
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    public class memberof     {
         public static void main (String[] args)     {
              Hashtable env = new Hashtable();
              String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
              String adminPassword = "XXXXXXX";
              String ldapURL = "ldap://mydc.antipodes.com:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   //Create the initial directory context
                   LdapContext ctx = new InitialLdapContext(env,null);
                   //Create the search controls          
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Andrew Anderson))";
                   //Specify the Base for the search
                   String searchBase = "DC=antipodes,DC=com";
                   //initialize counter to total the group members
                   int totalResults = 0;
                   //Specify the attributes to return
                   String returnedAtts[]={"memberOf"};
                   searchCtls.setReturningAttributes(returnedAtts);
                   //Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        System.out.println(">>>" + sr.getName());
                        //Print out the groups
                        Attributes attrs = sr.getAttributes();
                        if (attrs != null) {
                             try {
                                  for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
                                       Attribute attr = (Attribute)ae.next();
                                       System.out.println("Attribute: " + attr.getID());
                                       for (NamingEnumeration e = attr.getAll();e.hasMore();totalResults++) {
                                            System.out.println(" " +  totalResults + ". " +  e.next());
                             catch (NamingException e)     {
                                  System.err.println("Problem listing membership: " + e);
                   System.out.println("Total groups: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                   System.err.println("Problem searching directory: " + e);
    Any help will be highly appreciated.

    Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group. Through this memberof class I am trying to find full qualified name(DN) of my group.
    code I have used:
    //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "";
    Also I have used,
                 String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "ou=ibmgroups,o=ibm.com";
    But in both cases I am getting value for Total groups as 0.
    Code Reference:
    * memberof.java
    * December 2004
    * Sample JNDI application to determine what groups a user belongs to
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    public class memberof     {
         public static void main (String[] args)     {
              Hashtable env = new Hashtable();
              String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
              String adminPassword = "XXXXXXX";
              String ldapURL = "ldap://mydc.antipodes.com:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   //Create the initial directory context
                   LdapContext ctx = new InitialLdapContext(env,null);
                   //Create the search controls          
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Andrew Anderson))";
                   //Specify the Base for the search
                   String searchBase = "DC=antipodes,DC=com";
                   //initialize counter to total the group members
                   int totalResults = 0;
                   //Specify the attributes to return
                   String returnedAtts[]={"memberOf"};
                   searchCtls.setReturningAttributes(returnedAtts);
                   //Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        System.out.println(">>>" + sr.getName());
                        //Print out the groups
                        Attributes attrs = sr.getAttributes();
                        if (attrs != null) {
                             try {
                                  for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
                                       Attribute attr = (Attribute)ae.next();
                                       System.out.println("Attribute: " + attr.getID());
                                       for (NamingEnumeration e = attr.getAll();e.hasMore();totalResults++) {
                                            System.out.println(" " +  totalResults + ". " +  e.next());
                             catch (NamingException e)     {
                                  System.err.println("Problem listing membership: " + e);
                   System.out.println("Total groups: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                   System.err.println("Problem searching directory: " + e);
    Any help will be highly appreciated.

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

  • How to create a sum on change of a detailed record without using groups

    Hi,
    I'm working on an overtime/payroll report.  Overtime hours are calculated based on hours worked greater than 40 within the span of Sunday to Saturday.  Further, pay periods are every two weeks and do not align with the calendar week of sunday to saturday.
    I've managed to figure out how to do the overtime calculation from sunday to saturday and then the totals for each of these calendar weeks. However, I'd also like to calculate the totals for the pay periods.  I cannot group on both the calendar week AND the pay period id because sometimes the calendar week starts before the pay period starts and sometimes the pay period starts before the calendar week. So, one is not a sub-group of the other.  I tried setting both up as groups but it, unfortunately, resets by hour calculations at the wrong point because when one group is still going the other is ending.
    So, the report is working well with just the one group - calendar week (oh, and there is a higher level group - employee id as this calculation is done for each employee). I can include the pay period id in the detail lines and I can see when it changes. So, if I could create a formula that summed the hours by pay period id and than reset when a new pay period id begins that is what I am after. I just want the sum of hours upon each change of pay period id.  I'll attempt to show what the data looks like below:
    Group 1: Employee Name (say Fred Jones)
       Group 2: Week Beginning January 8, 2012
    Date  RegularHours   OvertimeHours  PayPeriodId
    Jan 8        12                              0                            1
    Jan 9        12                              0                            1
    Jan 10      12                              0                            1
    Jan 11       4                               8                            1
    Jan 12       0                               12                          1
    Jan 13       0                               9                            1
    Jan 14       0                               6                            1
    Total      40                          35                   
    Group 2: Week Beginning January 15, 2012
    Date  RegularHours   OvertimeHours  PayPeriodId
    Jan 15      12                              0                            1
    Jan 16      12                              0                            1
    Jan 17      12                              0                            1
    Jan 18       4                               9                            2
    Jan 19       0                               10                          2
    Jan 20       0                               8                            2
    Jan 21       0                               7                            2
    Total      40                          34                   
    So, the total hours for pay period #1 should be:
    RegularHours   OvertimeHours
    76                                35
    And, the total hours for pay period #2 should be:
    RegularHours   OvertimeHours
    4                                   34
    I tried creating a formula: Distinctcount ({@OT Hours}, {Command.pay_periods_id}) but Crystal says I cannot summarize the formula that is in it.
    I'm not a programmer but it feels like a loop of some sort (For each, unique pay period id sum the OT Hours).
    Any and all help much appreciated in advance!
    Mark
    Edited by: mahewitt on Feb 14, 2012 4:42 AM

    Hi Mark,
    Here's something I have come up with:
    1) Create this formula and place it on the details section beside the PayPeriodID field.Replace in the formula with PayPeriodId, with RegularHours and with OvertimeHours.
    WhilePrintingRecords;
    numbervar array reg_hrs;
    numbervar array ot_hrs;
    numbervar array payid;
    numbervar reg;
    numbervar ot;
    numbervar x;
    numbervar y;
    if not({PayperId} in payid) then
        y := y + 1;
        redim preserve payid[y];
        payid[y] := {PayperId};
    if onlastrecord then
        reg := reg + {Regular};
        ot := ot + {Overtime};
        x := x + 1;
        redim preserve reg_hrs[x];
        redim preserve ot_hrs[x];
        reg_hrs[x] := reg;
        ot_hrs[x] := ot;
    else if {PayperId} = next({PayperId}) then
        reg := reg + {Regular};
        ot := ot + {Overtime};
    else
        reg := reg + {Regular};
        ot := ot + {Overtime};
        x := x + 1;
        redim preserve reg_hrs[x];
        redim preserve ot_hrs[x];
        reg_hrs[x] := reg;
        ot_hrs[x] := ot;
        reg := 0;
        ot := 0;
    2) Create this formula and place it on the Group Footer 1 (Employee Name group):
    WhilePrintingRecords;
    numbervar array payid;
    numbervar array reg_hrs;
    numbervar array ot_hrs;
    numbervar i;
    stringvar final;
    for i := 1 to ubound(payid) do
        final := final + "For Pay Period # "&payid<i>&chr(13)&chr(13)&"Regular Working Hours are :"&reg_hrs<i>&chr(13)&"Overtime Hours are :"&ot_hrs<i>&chr(13)&chr(13)&chr(13)
    final;
    3) Right-click this field and select Format Field > Common tab > Check the 'can grow' option and increase the horizontal size of the formula field to around 3.5 to 4'
    4) Create this formula to reset the variables at the Group Header 1. This will make sure it prints the Regular and Overtime hours for every employee:
    whileprintingrecords;
    numbervar array reg_hrs := 0;
    numbervar array ot_hrs := 0;
    numbervar array payid := 0;
    numbervar reg := 0;
    numbervar ot := 0;
    numbervar x := 0;
    numbervar y := 0;
    numbervar i := 0;
    stringvar final := "";
    You may then hide the 1st and the last formula (Right-click > Format field > Common tab > Suppress)
    Let me know how this goes!
    -Abhilash

  • 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

  • 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

  • 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

  • Page level totals in a matrix report

    hi all,
    Is it possible to have any kind of page level totals in a matrix report??
    i tried it manually, but it gave me an error as follows,
    REP-1266: Column '<column name>': Page Level columns are not allowed in a Cross Product.
    Thanks
    Martin

    Martin,
    Is one of your report Repeating frames set to break on pages? If so, then go to the data model and create the variables you need inside the group of the repeating frame. If you are doing a summary column, don't forget to set the repeat at: property correctly. Then just carefully add the fields to the layout. The matrix layout can be very difficult to work with so what I do is carefully expand out all the frames so they are not overlapping with the outermost frame being on the very outside. Use the Fill Color setting on the layout to paint the frames so you can see what is sitting on top of what. It may take a few shots to get it right.
    Have you worked with Oracle analytic functions? They can really make your life easy by doing all of the summing at various levels. Also look into GROUPING SETS they are the bomb! Check out the URL below for more info:
    http://orafaq.com/node/55
    Good luck,
    matt

  • 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

  • Using Groups in SharePoint from Active Directory

    Hello,
    Is it possible to use groups in SharePoint from AD?
    I have several groups in AD that I would like to use in SP. Of course SP has its own set up groups in permission (Owner, Member and Visitor). I do not want to use these groups. What I would like to do is use groups that are in my AD and assign those the
    designer, contributor, read-only..etc permission.
    For example, SP people picker finds my AD group called "Finance_Project" and assign this group with permission rights as a contributor.
    Is this doable in SharePoint. I would think since SharePoint can be authenticated with AD, you should be able to use your own AD groups.
    Any suggestions, articles and answers are greatly appreciated.
    artisticweb

    You can do this in SharePoint. are you importing the AD groups via UPA?
    Creating a SharePoint group and adding an Active Directory group to its members…this allows anyone in the Active Directory group to participate in the SharePoint group
    Mapping roles directly to Active Directory groups and not using SharePoint groups at all.
    here is couple of article which will explain your choices one over to other
    Assign permission levels in SharePoint 2013
    Using Active Directory Vs. SharePoint Groups
    http://sergeluca.wordpress.com/2013/07/06/sharepoint-2013-use-ag-groups-yes-butdont-forget-the-security-token-caching-logontokencacheexpirationwindow-and-windowstokenlifetime/
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • 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

  • Error while using Group By on 2 Querys joined by union

    Hello Everyone
    I have a situation where in one report i cannot group the data and in another report when i group the data i am unable to view subject area.
    I Had a Complex Request from my client , i have to claculate a report based on 2 dimensions i.e i am calculating 2 measures from one dimension and other 3 measures from other dimension and then using UNION to join both the querys , for the same description the data is being displayed in 2 rows , then i i tried to combine both the querys from union and trying to select from those then i am getting the result and the problem is i am unable to access the subject area , its giving "Either you do not have permission to use the subject area within Answers, or the subject area does not exist." Error , i am unable to add prompts to these request
    I want the investor Grants Row to be displayed in one Column , I am already using Group by in one of the querys.
    Study                      Cost            Approved         Committed                 Earned          Paid Balance
    Investigator Grants 350,000.00 113,770.78 0.00 0.00 0.00
    Investigator Grants 350,000.00 113,770.78 42,403.13 19,905.90 22,497.23
    Labs 23,000.00 0.00 0.00 0.00 0.00
    Study Drug 47,000.00 0.00 0.00 0.00 0.00
    Other 0.00 0.00 0.00 0.00 0.00
    Here is my query
    SELECT "- Protocol"."Protocol #" saw_0, "- Protocol"."Working Title" saw_1, CURRENT_DATE saw_2, "- Administration"."Display Currency Code" saw_3, "- Protocol"."Managing Country" saw_4, "- Protocol".Country saw_5, "- Protocol"."Country OPS" saw_6, "- Protocol"."EU Country" saw_7, "- Protocol"."GCO Region" saw_8, "- Protocol"."GPB Region" saw_9, "- Administration"."Study Cost" saw_10, SUM (IfNull("- Budget and Payment Facts"."Protocol Cost Line Item Amount - Display CCY",0) BY "- Administration"."Study Cost" ) saw_11, SUM(IfNull("- Budget and Payment Facts"."Committed Amount - Display CCY",0) BY "- Administration"."Study Cost") saw_12, SUM(IfNull("- Budget and Payment Facts"."Actual Amount - Display CCY",0) BY "- Administration"."Study Cost") saw_13, SUM(IfNull("- Budget and Payment Facts"."Amount Paid (SP) - Display CCY",0) BY "- Administration"."Study Cost") saw_14, SUM(IfNull("- Budget and Payment Facts"."Actual Amount - Display CCY",0)-IfNull("- Budget and Payment Facts"."Amount Paid (SP) - Display CCY",0) BY "- Administration"."Study Cost") saw_15, CASE WHEN "- Administration"."Study Cost" = 'Other' THEN 1 END saw_16 FROM "SPECTRUM Reporting" WHERE ("- Administration"."Display Currency Code" = 'USD') AND ("- Protocol"."Protocol #" = 'P31248') UNION SELECT "- Protocol"."Protocol #" saw_0, "- Protocol"."Working Title" saw_1, CURRENT_DATE saw_2, "- Administration". "Display Currency Code" saw_3, "- Protocol"."Managing Country" saw_4, "- Protocol".Country saw_5, "- Protocol"."Country OPS" saw_6, "- Protocol"."EU Country" saw_7, "- Protocol"."GCO Region" saw_8, "- Protocol"."GPB Region" saw_9, "- Administration"."Study Cost" saw_10, IfNull("- Budget and Payment Facts"."Protocol Cost Line Item Amount - Display CCY",0) saw_11, IfNull("- Budget and Payment Facts"."Committed Amount - Display CCY",0) saw_12, 0.00 saw_13, 0.00 saw_14, 0.00 saw_15, CASE WHEN "- Administration"."Study Cost" = 'Other' THEN 1 END saw_16 FROM "SPECTRUM Reporting" WHERE ("- Protocol"."Protocol #" = 'P31248') AND ("- Administration". "Display Currency Code" = 'USD') ORDER BY saw_16 DESC
    Any help is appreciated ..!
    ~Srix

    Here is the query i used to group the data but i cannot access Answers with this query
    SELECT saw_0 saw_0, saw_1 saw_1, saw_2 saw_2, saw_3 saw_3, saw_4 saw_4, saw_5 saw_5, saw_6 saw_6, saw_7 saw_7, saw_8 saw_8, saw_9 saw_9, saw_10 saw_10, SUM(saw_11 BY saw_10) saw_11, SUM(saw_12 BY saw_10 ) saw_12, SUM(saw_13 BY saw_10) saw_13, SUM(saw_14 BY saw_10) saw_14, SUM(saw_15 BY saw_10) saw_15, saw_16 saw_16 FROM (SELECT "- Protocol"."Protocol #" saw_0, "- Protocol"."Working Title" saw_1, CURRENT_DATE saw_2, "- Administration"."Display Currency Code" saw_3, "- Protocol"."Managing Country" saw_4, "- Protocol".Country saw_5, "- Protocol"."Country OPS" saw_6, "- Protocol"."EU Country" saw_7, "- Protocol"."GCO Region" saw_8, "- Protocol"."GPB Region" saw_9, "- Administration"."Study Cost" saw_10, SUM (IfNull("- Budget and Payment Facts"."Protocol Cost Line Item Amount - Display CCY",0) BY "- Administration"."Study Cost" ) saw_11, SUM(IfNull("- Budget and Payment Facts"."Committed Amount - Display CCY",0) BY "- Administration"."Study Cost") saw_12, SUM(IfNull("- Budget and Payment Facts"."Actual Amount - Display CCY",0) BY "- Administration"."Study Cost") saw_13, SUM(IfNull("- Budget and Payment Facts"."Amount Paid (SP) - Display CCY",0) BY "- Administration"."Study Cost") saw_14, SUM(IfNull("- Budget and Payment Facts"."Actual Amount - Display CCY",0)-IfNull("- Budget and Payment Facts"."Amount Paid (SP) - Display CCY",0) BY "- Administration"."Study Cost") saw_15, CASE WHEN "- Administration"."Study Cost" = 'Other' THEN 1 END saw_16 FROM "SPECTRUM Reporting" WHERE ("- Administration"."Display Currency Code" = 'USD') AND ("- Protocol"."Protocol #" = 'P31248') AND ("- Payment"."Payment Number"="- Payment"."Related Payment Request Number")
    UNION SELECT "- Protocol"."Protocol #" saw_0, "- Protocol"."Working Title" saw_1, CURRENT_DATE saw_2, "- Administration". "Display Currency Code" saw_3, "- Protocol"."Managing Country" saw_4, "- Protocol".Country saw_5, "- Protocol"."Country OPS" saw_6, "- Protocol"."EU Country" saw_7, "- Protocol"."GCO Region" saw_8, "- Protocol"."GPB Region" saw_9, "- Administration"."Study Cost" saw_10, IfNull("- Budget and Payment Facts"."Protocol Cost Line Item Amount - Display CCY",0) saw_11, IfNull("- Budget and Payment Facts"."Committed Amount - Display CCY",0) saw_12, 0.00 saw_13, 0.00 saw_14, 0.00 saw_15, CASE WHEN "- Administration"."Study Cost" = 'Other' THEN 1 END saw_16 FROM "SPECTRUM Reporting" WHERE ("- Administration"."Display Currency Code" = 'USD') AND ("- Protocol"."Protocol #" = 'P31248')) T GROUP BY saw_0, saw_1, saw_2, saw_3, saw_4, saw_5, saw_6, saw_7, saw_8, saw_9, saw_10 , saw_11, saw_12, saw_13, saw_14, saw_15, saw_16 ORDER BY saw_0, saw_1, saw_2, saw_3, saw_4, saw_5, saw_6

  • PO with Total Price amount calculated is incorrect at the time of printing.

    Hi Experts,
    I have one PO with Total Price amount calculated is incorrect at the time of printing.
    When my  user took the first print out the PO shows the incorrect Total amount.
    After 10 mins my user taken the printout again,that time it shows the Toatal Price value is correct amount.
    How i can analysis this type of BUG..!!!
    I am thinking it might be BUG...???
    Please advice with you valuable inputs.
    Best Regards,
    RK

    Hi,
    Are you using the standard programm and print form or are you using your own?. Most of the printing issues happens because of own programms. Try with the standard and then you will be able to see why is this happening.
    Best Regards,
    Arminda Jack

Maybe you are looking for