Need SAP Crystal Report formula for Blance Quantity

Hi,
     i really need a formula for SAP Crytal report my requirement is
    i have group 2 Groups  one on sale order and another one on Invoice
   Example:
        ================================================================
          Order No:100001 
         Order Quantity:1000
      =================================================================
      Detail Area invoice group
      INV#        INVQty   CreditNoQty        Balance
     10002       100               0                       900
     10003        500             100                    500   
       i need formula for balance quantity . the balance quantity subtract from order quantity and plus with credit note quantity.

Try this:
1) Modify the code above to:
Whileprintingrecords;
Numbervar x := x +1;
If x = 1 then
Numbervar t := ({Order qty} - Invqty) + {Credit};
Else
t := ({Order qty} - t) + {credit}
2) Create a reset formula and place this on the group header 1:
Whileprintingrecords;
Numbervar x := 0;
Numbervar t := 0;
-Abhilash

Similar Messages

  • Crystal Report Formula for traversing the Hierarchy

    Hi Friends,
    I have a Hierarchy Node Variable in Query Designer and I use the same in my Crystal Report.
    I need to create a formula, which will traverse and find all of the child nodes of the selected Hierarchy Node (through the variable). Could you please let me know if this is possible and send me the code.
    Thanks in Advance!
    Regards,
    Vinaya Paulraj.

    Hi Vinaya
    In Crystal, under the 'Report' menu, there is an item called ''Hierarchical Grouping Options'. This item allows you to sort information based on the relationship between two fields.
    For example:
    The following example is based on using the sample database called Xtreme that ships with Crystal Reports and Xtreme's Employee table.
    There is an {Employee ID} field and {Reports to} field in the Employee table. These fields both contain an Employee ID number. There can be employees with employees that report to them. In other words, there can be employees that report to a higher level of management. You want to see the overall hierarchy of the employees. To do so, you would use the 'Hierarchical Grouping Option' in Crystal Reports.
    To view the employee hierarchy from the Employee table, complete the following:
    1. Create a group and group on {Employee ID}. You want to group on {Employee ID} because you want to see the overall hierarchy of employees.
    · From the 'Insert' menu, select 'Group'.
    · From the 'Insert Group' dialog box, select {Employee.Employee ID} in the first drop-down list.
    · Click 'OK'.
    2. Create a hierarchical group.
    · From the 'Report' menu, select 'Hierarchical Grouping Options'.
    · Select 'Sort Data Hierarchically'.
    · Select {Reports to} from the drop-down list for 'Parent ID'. In this example, the {Reports to} field is the parent field; therefore, we must select it in the 'Parent ID' field.
    3. Indenting the hierarchical group, you must enter a value between 0 and 4 inches.
    The 'Group Indent' setting only affects the display of the report. If you enter a value other than zero (0) the various levels of hierarchy will appear indented when the report is previewed. Thus making it easier to see the various groups of employees, managers, etc.
    For more information, search the online help for 'Grouping data hierarchically'.
    Regards
    Girish

  • SAP Crystal reports formula fields

    hi,
        how to use formula fields in crystal report.
                         thanks & regards,vinoth

    Hi Vinoth,
    That's a very vague question.
    You can create formulae via the Field Explorer > Formula option.
    After you save and close the formula editor, you need to drag and drop the formula on the report for it to execute.
    If you need help with a formula, please post the requirement.
    -Abhilash

  • Need a Crystal Report formula to concatenate strings during reading records

    I have a report that takes partnumbers and cross references them with other partnumbers.
    I have this information in the details
    Partnumber   XRef                          I need this as the string
    A                  B                              B
    A                  C                              B,C
    A                  D                              B,C,D
    And then start the a new string when it gets to a new partnumber.  Does anyone know how to do this?
    Thanks
    siboyd

    Hi,
    please create a formula field named "MySharedVariableTestGroupHeader" with the following code:
    shared StringVar mySharedVar := "Start";
    Then create a second formula field named "MySharedVariableTestDetails" with the following code:
    shared StringVar mySharedVar;
    mySharedVar := mySharedVar + " Next ";
    Now create a thrid formula field named "MySharedVariableTestGroupFoot" with the following code:
    shared StringVar mySharedVar;
    mySharedVar;
    Insert the newly created formula fileds in your report as follows:
    MySharedVariableTestGroupHeader -> Group header section
    MySharedVariableTestDetails -> Details section
    MySharedVariableTestGroupFoot -> Group footer section
    Watch what is displayed in your group footer.
    I hope I am able to give you an idea about what you can do by using shared variables in Crystal Reports.
    Regards,
    Stratos

  • SAP Crystal Report - Formula in Cross Tab Report

    I have a below requirement in a cross tab report,
    Category          Name          Valu1          Value2    %ge
    A                       Car               40                  50        80
    A                        Bike             30                  60        50
    Total                                       70               110     63.6
    %ge is a formula field and is calculated as value1/value2 * 100
    Consider the Total section as a group footer.
    In the cross tab report how do I put the formula field for %ge in Total section.

    Vishujain
    Crosstabs are very structured and you are limited in what you can do with them. You can do a percentage summary in Crosstabs, but only as a percentage of the row total or the percentage of the column total. You cannot put a formula in the crosstab to do a percentage of a values in seperate rows. Any time I need to perform a function not available in a crosstab, I do a manual cross tab. Look at: [Manual Crosstab Explaination|Re: Formulas : Help for coding]
    Debi
    Edited by: Debi Herbert on Nov 3, 2011 11:51 AM

  • SAP Crystal Report 2013 for Classic ASP

    Hi
    I'm have question about CR2013
    1. For CR V.2013 support classic ASP ?
    2. If support, It coding for view report with web browser ? (Example source code)

    Sorry but no. Classic ASP is gone, never to come back.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
      Follow us on
    Twitter

  • "SAP Crystal Reports, developer version for Microsoft Visual Studio" (CRforVS_13_0_9.exe) has error during Installation.

    Hello,
    I just tried to install the new file CRforVS_13_0_9.exe on a Windows 7 Ultimate machine.
    I have Visual Studio 2013 and wanted Crystal Reports to be fully integrated with it.
    By the way, I had already uninstalled CRforVS_13_0_8.exe before I attempted the installation of CRforVS_13_0_9.exe.
    However, the installation failed with the following error message...
    "The installation failed prematurely." The error dialog box with a full error message is attached.
    It may be significant to note that even after what looks like a failed installation, that "SAP Crystal Reports, version for Microsoft Visual Studio" (ver. 13.0.9.1312) does show up in the Programs and Features Control Panel).
    Any help/advice would be greatly appreciated. Please advise.
    Tom Davey

    This used to be quite common on WIN XP and Vista and it was an MS issue. Googling I found the following that may help:
    Fast and easy Windows Error Code 2753 resolution
    Error 2753 Preventing Uninstall/Reinstall - Microsoft Community
    Windows Installer Error Messages (Windows)
    For now, this is the only report of the error with SP 9, so it will be good to check if the above helps.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Crystal Report formula with datediff not working as expected

    We need a Crystal Report formula to display the number of seconds the oldest arriving call has been waiting.  Across multiple resources that can each have an "oldest call".  The database stores a datetime value for the time the oldest call arrived.  If there are no waiting calls, then this field is NULL.  (MSSQL database).  It seemed reasonable to implement this in a formula that 1) discovers the minimum of "oldest call" timestamps in the selected records, and 2) to use "datediff" to produce the difference (in seconds) between the "oldest call" timestamp and current time.
    The first attempt at this relied on "implied" iteration that could be done within a formula.  Something like:
    data: OLDESTARRIVALTIME
           null
           '2014-06-14 08:08:08.000'
           null
          '2014-06-14 08:07:55.000'
           null
    whilereadingrecords;
    datetimevar minArrival;
    if isNull({SVCCLASSMEASURES_VW.OLDESTARRIVALTIME}) = False
                   and minArrival < {SVCCLASSMEASURES_VW.OLDESTARRIVALTIME} then
         minArrival := {SVCCLASSMEASURES_VW.OLDESTARRIVALTIME};
    DateDiff("s", minArrival, {SVCCLASSMEASURES_VW.UTCDATE})
    We tried storing the values of OLDESTARRIVALTIME in an array.  We could see it iterating, but the values in the array only contained
    the column value from the first record.
    This was to solve the problem of screening null values and producing the minimum of the set.
    Since that didn't work (and the web articles seemed to imply this would iterate over all the records, we tried another approach.  This
    time we set NULL timestamps in the table to a timestamp far in the future, so that we could directly apply "minimum" to produce
    the correct "begin" for datediff.
    data: OLDESTARRIVALTIME
              '2030-01-01 00:00:00.000'
              '2014-06-14 08:08:08.000'
              '2030-01-01 00:00:00.000'
              '2014-06-14 08:07:55.000'
              '2030-01-01 00:00:00.000'
    datetimevar minArrival = minimum({SVCCLASSMEASURES_VW.OLDESTARRIVALTIME});
    datetimevar minUTC = minimum({SVCCLASSMEASURES_VW.UTCDATE});
    if minArrival < minUTC then
         DateDiff("s", minArrival, minUTC)
    else
         0
    (minUTC would be current time in UTC)
    So, to start things off, the last formula produces negative numbers!  They hover in negative seconds within a negative minute (-33, -45, etc.).
    That's inconceivable, considering the test for minArrival < minUTC.  Both of the fields are "datetime".
    As it turns out, in the near term, it's most important to get the second formula working.  And, of course, insights into getting the first
    formula to work are welcome as well!
    Have we run into some weird behavior of the "DateDiff" function?
    Thanks!

    If DateDiff is always returning a negative number you could try swapping the dates around in the call to DateDiff - it should look like this:
         DateDiff("s", minUTC, minArrival)    
    Or you could use the Absolute Value of the calculation:
         Abs(DateDiff("s", minUTC, minArrival) )
    As for your first formula, you need to initialize the variable to a value prior to using it in the comparison.  If you don't, its value is null and comparing it against a value won't work.  (See What is Null and Why is it Important for Crystal Reports | SAP BI BLOG for a blog that I wrote about working with nulls in Crystal.)
    You should change your existing formula to something like this:
    whilereadingrecords;
    datetimevar minArrival;
    if OnFirstRecord then minArrival := DateTime(2013, 1, 1, 0, 0, 0);
    if not isNull({SVCCLASSMEASURES_VW.OLDESTARRIVALTIME})
                   and minArrival > {SVCCLASSMEASURES_VW.OLDESTARRIVALTIME} then
         minArrival := {SVCCLASSMEASURES_VW.OLDESTARRIVALTIME};
    Note how I changed the If statement.  Also, you want to replace minArrival with the field value if the field is less than the current value of minArrival - so you need to use ">" instead of "<" in the comparison.  Place this formula in the details section.  It will now show anything because of the semi-colon on the end.  This will ensure that it gets evaluated for every record.
    Now, create a second formula that looks like this:
    whileReadingRecords;
    datetimevar minArrival;
    DateDiff("s", minArrival, {SVCCLASSMEASURES_VW.UTCDATE})
    Place this formula in a footer section - it will not work in a header section.  If you need it in a header section you might be able to take the "whilereadingrecords" off of both formulas and use the "Maximum()" summary function to get the correct value.
    -Dell

  • Registration code not sent for Crystal Reports Basic for VS2008

    I need to know how to receive a CR registration code for VS2008.
    In VS2008 when I open a Crystal Report, I'm asked for a registration code.  So I registered at the SAP website for the CR Basic for VS2008 license, but all I received was an email below.  So where is my registration code for this? Where can I get one so I can stop the nag screen.
    Email received below:
    Thank you for registering SAP Crystal Reports, version for Visual Studio .NET 2008.
    As a registered user of SAP Crystal Reports, version for Visual Studio .NET, you'll be the first to receive notifications of product news and updates, beta programs, and special events.
    Make the SAP Crystal solutions support site your primary destination for technical support. Search the knowledge base, read and post to the forums, browse articles, and download service packs.
    Tap into the full power of the SAP Crystal Reports product line. Visit our website, to learn more about optimizing your business, download trial software, and explore upgrade paths that can help you support larger deployments and diverse user needs.
    Thank you for choosing SAP Crystal Reports, version for Visual Studio .NET.
    Sincerely,
    SAP.com Customer Service

    This is not a technical support issue as such. Please call 866-681-3435. They should be able to help you out.
    - Ludek

  • SAP Crystal Report using SQL Server Authentication and Windows Authenticati

    I'm a SAP Crystal Report, version for Visual Studio 2010 Beginner
    my ingredients are
    1.windows 7 ultimate service pack1
    2.sql server 2008 standard edition
    3.visual studio 2010 pro
    4.SAP Crystal Report, version for visual studio.net
    I was created a report named customersByCity.rpt using OLE DB (ADO) -> Microsoft OLE DB Provider for SQL Server -> I'm supply Server, User ID, Password and Database. I assume me using SQL Server Authentication for my report
    Then, my ASP.NET files as following
    //ASP.NET
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="viewCustomersByCity.aspx.cs" Inherits="viewCustomersByCity" %>
    <%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
        Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div><asp:Label ID="lblMsg" runat="server" BackColor="Yellow" ForeColor="Black"></asp:Label>
     <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"></CR:CrystalReportViewer>
        </div>
        </form>
    </body>
    </html>
    //code-behind
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Collections;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    public partial class viewCustomersByCity : System.Web.UI.Page
        private const string PARAMETER_FIELD_NAME = "city";   
        private ReportDocument customersByCityReport;
        private void ConfigureCrystalReports()
            ConnectionInfo connectionInfo = new ConnectionInfo();
            connectionInfo.ServerName = @"WKM1925-PCWKM1925";
            connectionInfo.DatabaseName = "Northwind";
            connectionInfo.UserID = "sa";
            connectionInfo.Password = "sysadmin25";
            SetDBLogonForReport(connectionInfo);
        private void SetDBLogonForReport(ConnectionInfo connectionInfo)
            TableLogOnInfos tableLogOnInfos = CrystalReportViewer1.LogOnInfo;
            foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
                tableLogOnInfo.ConnectionInfo = connectionInfo;
        private void SetCurrentValuesForParameterField(ReportDocument reportDocument, ArrayList arrayList)
            ParameterValues currentParameterValues = new ParameterValues();
            foreach (object submittedValue in arrayList)
                ParameterDiscreteValue parameterDiscreteValue = new ParameterDiscreteValue();
                parameterDiscreteValue.Value = submittedValue.ToString();
                currentParameterValues.Add(parameterDiscreteValue);
            ParameterFieldDefinitions parameterFieldDefinitions = reportDocument.DataDefinition.ParameterFields;
            ParameterFieldDefinition parameterFieldDefinition = parameterFieldDefinitions[PARAMETER_FIELD_NAME];
            parameterFieldDefinition.ApplyCurrentValues(currentParameterValues);
        protected void Page_Load(object sender, EventArgs e)
            customersByCityReport = new ReportDocument();
            string reportPath = Server.MapPath("customersByCity.rpt");
            customersByCityReport.Load(reportPath);
            ConfigureCrystalReports();
            ArrayList arrayList = new ArrayList();
            arrayList.Add("paris");
            arrayList.Add("Madrid");
            arrayList.Add("Marseille");
            arrayList.Add("Buenos Aires");
            arrayList.Add("Sao Paulo");
            ParameterFields parameterFields = CrystalReportViewer1.ParameterFieldInfo;
            SetCurrentValuesForParameterField(customersByCityReport, arrayList);
            CrystalReportViewer1.ReportSource = customersByCityReport;
    1st scenario
    When in a runtime, it's keep appear a dialog box. This dialog box ask me to suppy Server, User ID, Password and Database. Once all information is supplied, my report display the data as expected
    2nd scenario
    I change my report using OLE DB (ADO) -> Microsoft OLE DB Provider for SQL Server -> checked on Integrated Security. I just choose Server, and Database. I assume me using Windows Authentication
    When in a runtime, there's no dialog box as above. My report display the data as expected. really cool
    Look's like, when report using SQL Server Authentication there's some problem. but, when report using Windows Authentication, it's fine.
    I'm looking for comment. Please help me

    Hello,
    MS SQL Server 2008 requires you to install the MS Client Tools for 2008.
    Once install then update all of your reports to use the SQL Native 10 as the OLE DB driver.
    The try again, if it still fails search, lots of sample log on code in this forum.
    Don

  • Dynamic command execution fails in Crystal report viewer for parameters

    We are using the Crystal Report Viewer for the .Net Application on the client side.The reports are designed using Crystal Report XI R2.
    The issues that we are currently encountering is that, we are unable to load the combo-boxes in the pop-up for the parameters.
    All the reports have multiple commands and the variables are of 'dynamic' type.
    When the dialog box for requesting the pop-up comes up, It comes up empty even though they are linked to the respective commands.
    Also,For reports having multiple parameters we are unable to give a single dialog box to get in all the parameters.It appears as a series of prompts.
    Both,these issues are not encountered when the reports are launched via the Crystal reports developer tool.

    Hello Varun,
    I recommend to post this questionin the [dedicated NET forum|SAP Crystal Reports, version for Visual Studio;.
    This forum is monitored by qualified technicians and you will get a faster response there.
    Thank you for your understanding,
    Falk

  • Where to find Crystal Report Formats for SAP B1 8.8 (India Localization) ?

    Hi Experts,
    do anybody knows Where to find Crystal Report Formats for SAP B1 8.8 (India Localization) ?
    For example
    Sales Register
    Purchase Register
    Journal Register
    Sales Analysis - Crystal Report
    Purchase Analysis - Crystal Report
    Check Register - Crystal Report
    Production register
    Pending Sales Order
    Outstanding Receivable
    Outstanding Payable
    BankBook
    CashBook
    General Ledger
    BP Ledger (Customer / Supplier)
    Trial Balance
    Balance Sheet
    Profit & Loss Statment
    Cash Flow statment
    Excise reports
       RG 23 A Part I
       RG 23 A Part II
       RG 23 C Part I
       RG 23 C Part II
       Daily Stock Account
       RG 1
       ER 1
       etc....
    Documets Layout
       Incoming Payment
       Outgoing Payment
       Journal Entry
       Transaction Journal Report - Crystal Report
       Sales Quotation
       Sales Order
       Sales Delivery
       Sales Return
       Sales Invoice (A/R Invoice)
       Purchase Order
       Goods Receipt PO
       Purchase Goods Return
       Purchase Invoice (A/P Invoice)
      Inventory Transfer
      Inventory - Goods Receipt
      Inventory - Goods Issue
    Best Regards,
    Samir Gandhi

    Hi Neetu,
    Do you wish that at all customer site all concern involved in implemtation do the same work ?
    I believe ERP is meant for single entry system, and it should be true for implementation also, why to invest man hours for the same task ?
    I expect it standard reports should be released by SAP, so that speed of implementation improve, we have more nos. of satisfied customers.
    customised reports is all together different and it is understood that it is needed to be developed after study the exact requirement.
    Best Regards,
    Samir Gandhi

  • How to use the distinct key in formula field in SAP Crystal Reports

    I want to use the distinct key in formula field in SAP Crystal reports.
    When i'm using it shows an error.
    Please suggest me....

    Hi,
    Use DistinctCount keyword directly for your calculation instead of count(distinct(....
    Alternatively, if you want to avoid duplicate records, under "File" > "Report Options" make the 'Select Distinct Records' as True.
    Thanks,
    Raghavendra

  • Is crystal reports correct for me / my needs?

    i'm wondering if crystal reports is correct for my needs.  i don't mind investing the time / money to figure this out, but i really can't waste any time so i thought i'd ask the question first
    is crystal reports correct for my needs?
    some detail of my needs:
    1.  the report would be similar to an IKEA catalog: lots of pictures, different layouts (so different reports merged into one). reports need to "look bitchin'". needs to be "printer ready" in regards to size, crop lines, page numbers, etc.  my main concern here is basically "how limiting is crystal reports in data placement on the page"?
    2.  the data would come from a relatively large db (MS SQL, Oracle, mySQL, and maybe others).  size: about 40 million record main table, with supporting tables (i.e., relational). the db is not encrypted and is accessible if you have the main password.
    3.  i would like to send the reports to something like PDF, but also to excel and text file.
    4.  i would like to offer the reports to my clients as part of my own software package, so hopefully this consists of an .exe file only (no updates required, etc).
    i would prefer to talk to a live person about this, or ideally see a quick demo of what is possible with crystal reports.  is this possible?

    Hello,
    Pictures can be a problem, they take up a lot of report space. I assume your pictures are in the database? Large reports get very large quickly with pictures ( ole object ).
    What you could do is download the trial version of CR 2008 and the sample reports:
    Go to this link: http://www.sdn.sap.com/irj/boc and download the trial version of CR XI R2 and use your XI keycode, then apply the patches which you can get to by clicking on the BusinessObjects tab above, then Downloads.
    Direct link to the Trial version: http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
    I also suggest you call Sales, they can send you links for demo's etc.
    https://smpdl.sap-ag.de/~sapidp/012002523100005852352008E/cr_xi_xtreme_rep_smpl_en.zip
    https://smpdl.sap-ag.de/~sapidp/012002523100006010272008E/feature_smpl.zip
    This may be of help also:
    https://smpdl.sap-ag.de/~sapidp/012002523100006010012008E/demo_smpl.zip
    Thank you
    Don

  • Sap crystal report for visual studio print error

    vs.net 2012 crystal report paper size 8.5in x 5.5in orientation portrait will not print properly. Always it prints landscape

    Don't define the paper size in the CR designer. Define it in the printer driver. Also, make sure you are using SP 10:
    SAP Crystal Reports, developer version for Microsoft Visual Studio: Updates & Runtime Downloads
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

Maybe you are looking for