Sum the sum of fields in crystal report

In crystal report 2008, i have rows of data grouped by document number. Sum of each document (RTotal1) display at Group Footer.
At the Report Footer level, I want to display the Grand Total. In formula workshop, I tried to add a formula to sum RTotal1 above. However, error message indicated 'this field cannot be summarized'.
Second try: In Running Total Fields, I tried to add RTotal1 above to the field but error message indicated 'invalid field selection'. Any idea what's the proper way to sum the sum of fields?

You need to use a variable, create 3 formula
@reset
whileprintingrecords;
global numbervar GTotal:=0;
//place this in report header, or higher grou header as appropriate
@Eval
whileprintingrecords;
global numbervar GTotal:=GTotal + Sum( valuefield, groupfield);
// place this in group footer where your sum shows
@display
whileprintingrecords;
global numbervar GTotal;
//Place this in report or higher group footer
Ian

Similar Messages

  • Trying to change the data source for a Crystal Report.

    <p>The method below represents my best attempt to programatically change the data source of a Crystal Report. The goal is to have a routine that will update the data source for reports after they have been distributed to production servers. So far I have not been successful in saving the report back to the CMS. No exceptions are thrown, but when I view the Database Configuration of the report in the CMC nothing has changed.
    </p>
    <p>
    Am I missing a step, or is there another way to accomplish this?
    </p>
    <p>
    Thank you.
    </p>
    <hr />
    <pre>
    private void test(String reportName)
       throws SDKException, ReportSDKException, java.io.IOException
       IInfoObjects newInfoObjects;
       IInfoObject reportObj;
       ReportClientDocument clientDoc = new ReportClientDocument();
       DatabaseController dc;
       PropertyBag pBag;
       PropertyBag logonProps;
       ConnectionInfo newConInfo;
       ConnectionInfo oldConInfo;
       ConnectionInfos conInfos;
       int connOptions = DBOptions._ignoreCurrentTableQualifiers + DBOptions._doNotVerifyDB; //0;
       Fields connFields = null;
       String queryStr = "Select * From CI_INFOOBJECTS " +
          "Where SI_NAME='wfr.rpt' AND SI_KIND='CrystalReport' AND SI_INSTANCE=0";
       newInfoObjects = getCms().executeQuery(queryStr);
       if(newInfoObjects.size() > 0)
          reportObj = (IInfoObject)newInfoObjects.get(0);
          try
             clientDoc = getCms().getReportAppFactory().openDocument(
                reportObj
                , OpenReportOptions._refreshRepositoryObjects
                , java.util.Locale.US);
             dc = clientDoc.getDatabaseController();
             conInfos = dc.getConnectionInfos(null);
             for(int i = 0; i < conInfos.size(); ++i)
                oldConInfo = (ConnectionInfo)conInfos.getConnectionInfo(i);
                newConInfo = (ConnectionInfo)oldConInfo.clone(true);
                pBag = newConInfo.getAttributes();
                pBag.putStringValue("QE_ServerDescription", "alio");
                logonProps = new PropertyBag();
                logonProps.putStringValue("Trusted_Connection", "false");
                logonProps.putStringValue("Server", "alio");
                pBag.put("QE_LogonProperties", logonProps);
                newConInfo.setUserName("admin");
                newConInfo.setPassword("password");
                dc.replaceConnection(
                   oldConInfo
                   , newConInfo
                   , connFields
                   , connOptions);
          catch(ReportSDKServerException Ex)
             String msg = "A server error occured while processing the " + reportObj.getKind()
                + " object, " + reportObj.getTitle() + " (" + reportObj.getCUID() + "), from the CMS.";
             Utility.errorOut(msg, Ex);
          catch(Exception Ex)
             String msg = "An error occured while processing the " + reportObj.getKind()
                + " object, " + reportObj.getTitle() + " (" + reportObj.getCUID() + "), from the CMS.";
             Utility.errorOut(msg, Ex);
          finally
             clientDoc.save();
             getCms().commitToInfoStore(newInfoObjects);
             clientDoc.close();
    </pre>
    Edited by: Mark Young on Sep 10, 2009 2:16 PM

    <style type="text/css">
    /<![CDATA[/
        body
            font-size: 1.125em;
              font-family: helvetica,arial,"sans-serif";
          .code{font-family: "courier new",courier,mono,monospace}
          .bi{font-style: italic; font-weight: bold;}
    /]]>/
    </style>
    <p>Justin,</p>
    <p>
    Thank you for the reply. Time constraints have not allowed me to post back to this tread
    till now. I will try your suggestion. My assumption is that <i>Save the report back to the
    info store</i> refers to <span class="code">IInfoStore.commit(IInfoObjects)</span>.
    </p>
    <p>
    I'm afraid that I do not understand why I don't want to change the report client document,
    or why <i>successfully exporting the report with the new login/password</i> is not what I
    want to do. Any explanation on that statement would be appreciated.
    </p>
    <p>
    I did find a way to accomplish my goal. It involved adding the SSOKEY property to the
    logon property bag. Below you'll see my revised code which modifies the report logon and
    server. I have no idea what
    this does, and SAP support has not been able to tell me why it works. However, what I
    discovered is that if I changed the report option, <b>Database Configuration -> When
    viewing report:</b>, in the CMS to <span class="bi">Use same database logon as when report
    is run</span> from <span class="bi">Prompt the user for database logon</span>, then the
    SSOKEY property had been added to the logon property bag having an empty string as its
    value. This allowed me to successfullyupdate and save the modified logon back to the CMS.
    </p>
    <p>
    So I took a chance and added code to always add the SSOKEY property with an empty string
    as its value, and I could then successfully modify and save the report's logon info
    and server. Again, I don't know what this means, but it has worked so far. If anyone has
    some insight or comments, either are welcome. Thank you in advance.
    </p>
    <br />
    <hr />
    <pre>
    private void changeDataSourceOfAWFCrystalReports()
       throws SDKException, ReportSDKException, java.io.IOException
       IInfoObjects newInfoObjects = null;
       IInfoObject reportObj = null;
       IReport curReport = null;
       ReportClientDocument clientDoc = new ReportClientDocument();
       DatabaseController dbController;
       PropertyBag pBag;
       PropertyBag logonProps;
       ConnectionInfo newConInfo;
       ConnectionInfo oldConInfo;
       ConnectionInfos conInfos;
       int connOptions = DBOptions._ignoreCurrentTableQualifiers + DBOptions._doNotVerifyDB;
       Fields connFields = null;
       String outputStr;
       int numOfReports;
       int numOfQueryPages;
       double progressIncrementPerPage = 30;
       int progressIncrementPerReport = 0;
       // Path query to reports is in a .properties file.
       String queryStr = getAppSettingsFile().getWscAwfCrystalReportPathQuery();
       try
          // Executes IInfoStore.getPageingQuery() and generates a list of queries.
          getCms().setPathQueryQueries(queryStr, 100);
          numOfQueryPages = 0;
          // Gets a List&lt;String&gt; of the IPageResult returned from IInfoStore.getPageingQuery().
          if(getCms().getPathQueryQueries() != null)
             numOfQueryPages = getCms().getPathQueryQueries().size();
          if(numOfQueryPages &gt; 0)
             // Use 30% of progress bar for the following loop.
             progressIncrementPerPage = Math.floor(30.0/(double)numOfQueryPages);
          for(int queryPageIndex = 0; queryPageIndex &lt; numOfQueryPages; ++queryPageIndex)
             // Gets the IInfoObjects returned from the current page query
             newInfoObjects = getCms().getPathQueryResultSetPage(queryPageIndex);
             numOfReports = newInfoObjects.size();
             if(newInfoObjects != null && numOfReports &gt; 0)
                progressIncrementPerReport =
                   Math.round((float)Math.floor(progressIncrementPerPage/(double)numOfReports));
                for(int reportIndex = 0; reportIndex &lt; numOfReports; ++reportIndex)
                   reportObj = (IInfoObject)newInfoObjects.get(reportIndex);
                   curReport = (IReport)reportObj;
                   clientDoc = getCms().getReportAppFactory().openDocument(
                      reportObj
                      , OpenReportOptions._refreshRepositoryObjects
                      , java.util.Locale.US);
                   dbController = clientDoc.getDatabaseController();
                   conInfos = dbController.getConnectionInfos(null);
                   for(int conInfosIndex = 0; conInfosIndex &lt; conInfos.size(); ++conInfosIndex)
                      oldConInfo = (ConnectionInfo)conInfos.getConnectionInfo(conInfosIndex);
                      newConInfo = (ConnectionInfo)oldConInfo.clone(true);
                      pBag = newConInfo.getAttributes();
                      pBag.putStringValue(
                         "QE_ServerDescription"
                         ,getConfigFile().getDBDataSourceConnections());
                      logonProps = new PropertyBag();
                      logonProps.putStringValue("Trusted_Connection", "false");
                      <b>logonProps.putStringValue("SSOKEY", "");</b>
                      logonProps.putStringValue(
                         "Server"
                         ,getConfigFile().getDBDataSourceConnections());
                      pBag.put("QE_LogonProperties", logonProps);
                      newConInfo.setUserName(getConfigFile().getUNVConnectionUserName());
                      newConInfo.setPassword(getConfigFile().getUNVConnectionPasswordDecrypted());
                      dbController.replaceConnection(
                         oldConInfo
                         , newConInfo
                         , connFields
                         , connOptions);
                      newConInfo = (ConnectionInfo)conInfos.getConnectionInfo(conInfosIndex);
                   } // end for on conInfosIndex
                   clientDoc.save();
                } // end for on reportIndex
             } // end if on newInfoObjects
          } // end for on queryPageIndex
       } // end try
       catch(ReportSDKServerException Ex)
          // handle...
       catch(Exception Ex)
          // handle...
       finally
          getCms().commitToInfoStore(newInfoObjects);
          if(clientDoc != null)
             clientDoc.close();
    </pre>

  • How to set a new value for formula field in crystal reports xi?

    <p>How to set a new value for formula field in crystal reports xi?</p><p>//formula</p><p>{@description}</p><p> </p><p>exemplo in VB6</p><p>crxSubreport.FormulaFields.Item(1).Text =  "&#39;Subreport Formula&#39;"  or</p><p>crxSubreport.FormulaFields.Item("description").Text =  "&#39;Subreport Formula&#39;"</p><p>How to in JRC?</p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p>

    Hi,
    This functionality is known to be very important and is a key part of the next major release of the JRC planned for the first half of 2008.
    Regards,
    <p>Blair Wheadon</p>
    <p>Product Manager, Crystal Reports</p>

  • Number field on crystal report displays Exponential form.

    Number Type field on crystal report printed in Exponential form when digits in this field are more than 17.

    Hi Jay,
    The same issue is addressed in the K-Base article c2005336. This is the limitation in Crystal, If you have more than 15 digits of numberic field it will convert into Exponential
    Use database-level syntax to convert the numeric database field to a string so that Crystal Reports will interpret it as a string type, and display all of the characters.
    For example, in Oracle, cast the number using to_char() and in Microsoft SQL Server use CAST() or STR() prior to adding the field to the report.
    As a workaround to display all the number, I would suggest you to convert it to text using a SQL Expression Field. A SQL Expression field will be evaluated on the database server.
    I would suggest you to follow the below mentioned steps to create SQL Expression field and convert a database field to a string:
    1. Open the report.
    2. Right click the SQL Expression field which is present in the Field Explorer.
    3. Select New and copy and past the below-mentioned text.
    CAST ("Database Field" as varchar)
    Note u201CDatabase Fieldu201D Here you have to mention your database field.
    After you create the SQL Expression Field, insert it on the report and it will display the full number.
    Please note that no calculation can be made on that field since it is now a string.
    I hope this helps you.
    Regards,
    Prashant

  • Using the same data field on a report

    Post Author: Lukey1972
    CA Forum: General
    Hi can anyone help me please? New to crystal reports and I have added the same Data field on a report being and I need to filter these one for Credits and the other for Debits. When I use Select Expert it effects both columns. I know that there is a logical way of doing this but being new have yet to be able to find it. Please help.

    Post Author: DHBelgium
    CA Forum: General
    Hi there,
    you can put a block filter on the data saying ex facturation is equal to c or to d leaving you only with credit or debit amounts.
    Are you using webi?
    Greetz,
    David

  • How to overcome the Memory leakage issue in crystal report 2008 SP2 setup.

    I have developed the small windows based application tool with help of  Visual studio 2008 for identify the memory consumption of crystal report object. It helps to load the crystal report objects in the memory and then released the object from the memory. The tool simply does the u201CLoading and Unloadingu201D the objects in the memory.
    The tool will be started once u201CTest_MemoryConsumption.Exeu201D executed. The u201CTest_MemoryConsumption.Exeu201D consumes u201C9768 KBu201D memory before load the crystal report object in memory. It means, 9768 KB is normal memory consumption for run the tool.
    Crystal report object initiated by the tool and object help to load the report in memory once the tool initiated the crystal report object. Now u201CTest_MemoryConsumption.Exeu201D consumes u201C34980 KBu201D memory during the crystal report object creation and report load process. The actual memory consumption of crystal report object is 34980u20139768=u201C25212u201DKBu201D. 
    The memory consumption u201C34980 KBu201D will be continued till the end of the process. The memory consumption will be reduced to u201C34652 KBu201D from u201C34980 KBu201D once report load process completed. It means, u201C328 KBu201D memory only released from the memory consumption. Tool enables the Release command for the crystal report object. But crystal report object does not respond to the command and will not release his memory consumption.
    The memory consumption u201C34652 KBu201D will be stayed in the memory once job ends.  If i again initiate the crystal report object then it crystal report object start to consume the memory from 34652 KB.
    Database objects and crystal report objects are properly used in the tool. The object release commands properly  communicated to crystal report setup. But the u201CCrystal report service pack 2u201D setup unable to respond the commands which has enabled from .Net Tool.  Crystal report objects are properly initiated and disposed in the tool. But the crystal report unable to release from the server.
    The memory consumption will be reduced once the server restarted or kill the application.
    Crystal report 2008 and crystal report 2008 SP2 setup available in the server.
    Microsoft .Net Framework 2.0 SP2, Microsoft .Net Framework 3.0 SP2 and Microsoft .Net Framework 3.5 SP1 are available in the server,
    Could you please suggesst how to avoid the memory consumption keep increasing and  how to release the memory consumption  once the crystal object disposed???

    Hi Don..
    My case is different one. I hope, the problem with Run time Installation setup file (Crystal report 2008 Serivce Pack2 installer) which we installed in the server.
    Let me explain with Live scenario which our client faced in crystal report 2008 Service pack2 Installer.
    Our client is using a application to help to print their reports. The application is developed with Windows service.
    Windows service keep on running in the server. Windows service executes the client 's crystal reports( Labels Report, Stock  report) which designed for clients need and the reports will be printed from printer. 
    10 Same type report (Label Report) will be printed in 1 minute. Reports are not printing during non business hours. But the windows service keep on running.  Memory cosumption of application will be 160 MB in business hours.
    For Example, On Monday the application memory consumption starts with 160 MB. The Memory consumption will be reached 165 MB  in peak business hours. Then the memory will be ended in163 MB in the End of Monday. It means, The memory consumption will be in 163 MB during the non business hours. Reports will not be printed in non business hours.
    On Tuesday, the application memory consumption starts with 163 MB and it will be reached 168 MB during the peak hours. The Memory consumption will be ended in 165 MB in the end of Tuesday.  The same process contiues till friday. End of friday, the memory consumption of the application will be ended with 170 MB.
    Application Memory Consumption slowly increasing in the server. In 5 days, Memory consumption reached Threshold value (170 MB) of the server. Application gets hanged up once the memory consumption reached 170 MB. We got the error messages as "Attempted to read write protected memory " / "Not Enough memory for process".  If we restart server / If we restart the service then memory consumption of application get reduced to 160 MB.
    From the above scenario, We came know that the either the problem with Application object or the problem crystal report object. In the application, We have checked dispose methods of application objects completly. I am sure that  application objects are properly disposed in the application. I hope the problem not with application objects. The problem with Crystal report objects.
    Application properly communicates the dispose methods to crystal report objects. Crystal report objects are not released from
    the memory.
    Crystal report 2008 Serive Pack 2 setup installed in the server. 
    As you said, If Crystal report runtime is not released from memory then memory consumption keep increase???  In service oriented architecture application, how to unload the crystal report runtime??
    Do you any fix for this kind of issue??
    Willl Crystal report 2008 service pack 3 help on this issue??

  • How to handle the OK button of the parameters prompt of a crystal report

    Hi,
    how to handle the OK button of the parameters prompt of a crystal report in vba.NET?
    I want to use the parameter prompt from the crystal report itself and I want to know when the report is ready. I need to export programatically by sending email to a list of employees after the parameters has been set. The emails I send depends on the results of the report.
    Im using a CrystalReportViewer control  in VS2010 and Crystal Report for VS2010 v13.0.1.220.

    Right. But the parameter screen is driven by the viewer. Unless you create your own parameter screen and pass the parameters to the report via code.
    Another thing I am not sure about:
    "Then by code I want to read all the employees id from the report and send email to them with specified pages of the report. (1 page per employee)"
    How do you plan on reading the employee ID from the report? I am not aware of any API that will read a value in a report so that you can then decide what page to send to whom.
    I think you're approaching this kinda backwards. A question to ask is; can you do what you are trying to do in code in the CR designer? If not, using APIs will not work either. I suspect your approach should be a report that uses an employee filter. Run the report for employee x, get the report populated with the data for that employee and email it. Repeat for employee x1, employee x2, etc.
    - Ludek

  • Return code 471 is returned from the server while saving a crystal report

    Hi All,
    The return code 471 is returned from the server while saving a crystal report.
    Could some one give me a solution how to overcome this problem and to save my crystal report.
    Thanks
    Jiten

    Hi Jitendra,
    request you to provide the complete error message along with the work-flow to reproduce the error and the version of both the Crystal Reports Designer and Enterprisee installed on the server.
    Regards,
    Jayendra.

  • Sum the Sum total values above

    Post Author: John Patterson
    CA Forum: Formula
    I have created a report that contains a list of values (in a group) that come from a formlar that has Sum {} totals in it.  All I want to do is sum that list into one value below, just like Excel would do!
    Crystal won't allow me to sum the results of group sum totals higher up the report.   I have been told that I need to create a conditional running total or a set a variable to store the values required.
    Any ideas?
    Many thanks
    John

    Post Author: fusion
    CA Forum: Formula
    Definitely Jami,I found out that Running Total is an answer. I still  need to find out how to get a percentage of the total using a running total. When you use a summary option then there is a option that allows you to have the filed as a % of the total of that filed. How can you do the same using running total. I am trying to work with formulas but no any luck so far.Your help is highly appreciated

  • Problem dislaying an Informix LVARCHAR field in Crystal Reports

    Post Author: littlew
    CA Forum: Data Connectivity and SQL
    I am creating a report using Crystal Reports XI from a BOXI Universe.  The Universe is connecting to an Informix Dynamic Server 9.21 database.  The Informix database contains a field which is a LVARCHAR data type.   A LVARCHAR data type is one which allows the storing of more than 255 characters (up to 2KB). 
    When I attempt to place the LVARCHAR data type field onto my report, Crystal Reports displays no data in my report for most of the other fields, and all the formulas return invalid results.  If I go into the Informix database and change the LVARCHAR field to CHAR (255) field, the Crystal Report will run with no problems.
    Does anyone know if Crystal Reports can support the displaying of fields from the database, which are greater than 255 characters?
    Also, I have created a Crystal Report which uses the same Informix data source using an ODBC connection and the LVARCHAR field caused the entire report not to display.   By changing the field from LVARCHAR to CHAR (255) the report runs fine.
    -bill

    Post Author: V361
    CA Forum: Data Connectivity and SQL
    I don't remember where I read it, but the field limit is 255 characters. Unless that has changed in CR 2008

  • Cant Display "Memo" Type Field in Crystal Report XI R2

    I am using Crystal Reports XI R2 and when I am trying view all of the fields in the Databse Expert, I click on Links and review the fields listed for my SAP OCRD table, I cannot see any of the "MEMO" type fields . I have recently upgraded from XI R1 and never had this problem until my conversion. Does anyone know if there is a setting or something to fix this issue. Thanks ahead time for your help.
    JIm Dyer

    Check this link
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303335333633323332%7D.do

  • How to group by more than one fields in crystal reports

    Hi
    How to create groups in crystal reports by more than one fields, like
    select fields,aggregate functions from table group by a,b,c

    Not sure if I understand your question, but you you could create a formula to generate the string of data you want to group on.  Then simply create a group based on the formula field.
    For example, your formula could do something like (assuming all String fields):
    {table1.FirstName} + {table1.LastName} + {table1.DateOfBirth}
    , and then group on this formula.
    -MJ

  • Binary field in crystal report.

    Dear all expert,
    i have a binary field in my crystal report, how can i display it as image in crystal report? or how can i make a hyperlink on it so when user click on it, it will open a new window for them to view the image?
    Thank You.

    Drop the field into the report, depends on the version of CR if it's supported though

  • Changing the data source of a Crystal Report

    Post Author: starmizzle
    CA Forum: Crystal Reports
    We're running a trial of BusinessObjects XI Release 2 to see if it fits our needs.
    We were told that we could import and publish our existing Crystal Reports and then later on go back and change their data sources to point to new universes as they're built.
    So I've published a simple Crystal Report that I can run and modify through Infoview. And I've created a universe with the appropriate fields and calculations that it needs. So how do I force my published report to use the new universe as its data source instead of the system DSN it had when it was made?

    Post Author: starmizzle
    CA Forum: Crystal Reports
    We're running a trial of BusinessObjects XI Release 2 to see if it fits our needs.
    We were told that we could import and publish our existing Crystal Reports and then later on go back and change their data sources to point to new universes as they're built.
    So I've published a simple Crystal Report that I can run and modify through Infoview. And I've created a universe with the appropriate fields and calculations that it needs. So how do I force my published report to use the new universe as its data source instead of the system DSN it had when it was made?

  • How to set formula field in crystal report

    Hello all,
    I develope the code in C#.NET and use SAP B1 2004C. I have a problem with crystal report. I have in crystal report one unbound field. This field is string type. I need in my code change value of this field to another text ex. ("test").
    I use this code:
    FormulaFieldDefinitions crFormula;
                FormulaFieldDefinition crFormulafieldD1;
                crFormula = crReportDocument.DataDefinition.FormulaFields;
                //FormulaFieldDefinition test;
                //bool test = crFormula.IsReadOnly;
                string error = "";
                bool isCorrect = true;
                crFormulafieldD1 = crFormula[1];           
                string ahoj = crFormulafieldD1.FormulaName;
                crFormulafieldD1.Text = " ""+OP.ToString()+"" ";
                isCorrect = crFormulafieldD1.Check(ref error);     
                // Display the error message if the syntax is incorrect.
                //if (!isCorrect) MessageBox.Show(error);
    The value of the field is set, but on the report isnt it. Why not. Can you help me. Send some sample.
    Thanks

    Hi
    I've never tried to change a field of the report directly. Maybe it would solve the problem if you make a parameter field, which you can use in the formula.
    You can set then the parameter field:               report.SetParameterValue("NameOfParam", valueOfParam);
    Regards,
    Martin

Maybe you are looking for