Crystal: Calculating percentages of fields

Alien777
04-19-2004, 02:37 AM
I need to compare 2 fields in my report and change the background colour according to certain criteria. The 2 fields are detailactual and detailstd. If detailactual is 25% more than detailstd then change detailactual to blue. But if detailactual is 25% less than detailstd then change detailactual to red. I have tried declaring variables in crystal but could not get them working.
How do I do this calculation?

MKoslof
04-19-2004, 08:27 AM
OK, are you using an .rpt file or a .dsr object. If creating a .dsr object through VB, you can get to the section formatting events. If using an .rpt file, your options aren't as flexible. Basically, getting a formula to calculate the totals isn't going to be your problem, changing the section color reliably might.

Do you want to calculate this total from VB or Crystal Reports? I would recommend using a formula native to Crystal Reports. Then, whileprintingRecords, evaluate these two fields within your formula. If a certain percentage is met, you do whatever event you need.

You said you tried this in Crystal already, can you post the formula you are currently trying? I am sure we can find the error and get it working.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum