Unable to do arithmetic operations for the fields of pojo class

Posted by: krishnan.m on 12 July 2021, 3:02 am EST

  • Posted 12 July 2021, 3:02 am EST

    Consider we have class A as below.

    Class A {
    int x;
    int y
    }
    

    In the grapecity template, I want the sum of x and y fields.

    I tried the following syntax after adding data source

    {{=ds.x+ds.y}}

    {{==ds.x+ds.y}}

    {{=={{ds.x}}+{{ds.y}}}}

    But none of them seems to be working.

    Pls let whether it is possible to do arithmetic operations for fields of pojo or not.

    If arithmetic operations is possible, pls let me know the syntax.

  • Posted 13 July 2021, 2:28 am EST

    Hello,

    We are discussing this with the development team and will get back to you with the updates soon.

    [Internal Tracking ID: DOCXLS-4451]

    Regards,

    Prabhat Sharma.

  • Posted 16 July 2021, 7:41 am EST

    Hello,

    As per the development team the first syntax {{==ds.x+ds.y}} should work properly.

    Are you able to get the values of x and y in the excel file?

    Please provide a stripped-down sample showing what you are doing exactly so that we can assist you further.

    Regards,

    Prabhat Sharma.

  • Posted 20 July 2021, 8:38 am EST

    Hi,

    I am using grapecity version 4.0.3.

    I can get the values of ds.x and ds.y separately in the excel file. But I am unable to get the sum of ds.x and ds.y by using the syntax {{==ds.x+ds.y}}.

    Pls see attached files and suggest me the right way to do it

    files.zip

  • Posted 21 July 2021, 5:29 am EST

    Hello,

    Thank you for sharing the files.

    Can you please also share the code snippet that you are using to populate the excel?

    Regards,

    Prabhat Sharma.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels