Saturday, February 25, 2012

amount manipulation in crystal report

I am developing a project in vb.net .
I am displaying the amount in my detail section.
There is a situation in which , if the amount is negative it has to be displayed as receipts and if else it has to be showed as payments .

like

Description Payments Receipts
monthly instalment 6000.23 0.00
finance charges 0.00 6000.23(this is -ve value)

I have struck here . Can any one help me to come out of this situation.

I am attaching two jpeg files in which

1 vbcode_rpt : will show the present look of the report.

2 PBcode_rpt : will show how i want the report to be presented.

thanks in advance

vijiPlz explain one thing to me that do have single Field in the database for Payments and Receipts or individual Field.

in ur case u can apply formula as (if its single Field)

if {Reportname.Field}<0 then
Payments
elseif {Reportname.Field} then
Receipts|||hai silly star

i got the solution for that situation.

Both the columns are one column in the database ie. the amount column for that description.

if the amount column value is < 0 then it has to be displayed as receipts and if it is > 0 then it has to be displayed as payments .

i added two unbound currency columns in the details section and in the formula dialog I added this formula to get my requirement done.

This is in the unbound_currency_column1 ie. Payments
if {tmp_ter_pool.Amount} > 0
then {tmp_ter_pool.Amount}
else
0.00

This is in the unbound_currency_column2 ie. Receipts
if {tmp_ter_pool.Amount} < 0
then {tmp_ter_pool.Amount}
else
0.00|||Its great u find the solution but did u try the one i told u?? :cool:

No comments:

Post a Comment