anupp1983 Posted December 8, 2010 Share Posted December 8, 2010 Hi, I am using jasper report3.6.I have created a report that has 1 column with value A or B. I have another numeric column whose Sum total is being shown at the bottom of the numeric column.The catch is that if the value is 'B' I want to subtract the amount and if the value is 'A' I want to add the amount to the total.For this I have used a condition in the 'Text field Expression' property. Here I add a '-' sign to the column amount.When the report is generated I can see the numeric figures as -ve or +ve but the summation is still not deducting the amount. It is still summing all of them.How should I go about solving this issue?Pls help me..Awaiting for ur response.... Thanks&RegardsAnup Link to comment Share on other sites More sharing options...
anupp1983 Posted December 8, 2010 Author Share Posted December 8, 2010 Hi, I am using jasper report3.6.I have created a report that has 1 column with value A or B. I have another numeric column whose Sum total is being shown at the bottom of the numeric column.The catch is that if the value is 'B' I want to subtract the amount and if the value is 'A' I want to add the amount to the total.For this I have used a condition in the 'Text field Expression' property. Here I add a '-' sign to the column amount.When the report is generated I can see the numeric figures as -ve or +ve but the summation is still not deducting the amount. It is still summing all of them.How should I go about solving this issue?Pls help me..Awaiting for ur response.... Thanks&RegardsAnup Link to comment Share on other sites More sharing options...
honeybakliwal Posted December 8, 2010 Share Posted December 8, 2010 Hi Anup,As per your issue you just have to create one variable of double type and in its variable expressionyou need to write one condition as described under(colummn.equlas'A'?column1.intvalue()+column2.intvalue:column1.intvalue()-column2.intvalue)If your name column is stringThen just drag and drop that variable into the detail band of your reportHence your issue will be solved/tools/fckeditor/editor/images/smiley/msn/regular_smile.gif With RegardsHoney Bakliwal Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now