Jump to content

how to substract column A and coumn B


anupp1983

Recommended Posts

  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&Regards

Anup

 

 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

 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&Regards

Anup

Link to comment
Share on other sites

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 string

Then just drag and drop that variable into the detail band of your report

Hence your issue will be solved/tools/fckeditor/editor/images/smiley/msn/regular_smile.gif

 

With Regards

Honey Bakliwal

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...