Crystal reports help possible here?

  • Thread starter Thread starter Robin Tucker
  • Start date Start date
R

Robin Tucker

Firstly, I'm using the .NET version (with VB) here, not the full version, I
have no
idea if this is possible -

I would like to change the colour of a rectangular box in the report
depending on the values of one of the fields in a record in the database,
which is contained in the report recordset. In other words, I think I need
some event that fires per row when generating the report. I cannot find
such a method either on ReportViewer control or in ReportDocument object.

Can anyone tell me how to do this please?

Apologies for cross posting.
 
HI Robin, since the report itself is iterative, i would think that you're
better off letting the report itself handle this. In your report definition
just go to "Format Field", "Border" tab... click the "Background" checkbox
and set a codition by clicking on the "X-2" button.

something along the lines of...
\\\
if {myTable.GrossProfit} <0 then
Red
else if {myTable.GrossProfit} = 0 then
Black
else
Green
///

this would set the field background color to red, if the value was less than
zero, black if it is zero and green if it's greater than zero.

hope this helps,

jim
 
Ah - ok, I didn't realise I could do this. Much better solution.

Thanks will give it a go.
 
Back
Top