Crystal Report column font set Dynamically based on a condition
I am using Crystal Report for generating Reports.
I have to set the font size and color of "Test Result" column based on
"Noramal Range" column.
if "Test Result" (12) is in range of "Normal Range"(12-13) then
size =15 and color =red
else
size =10 and color =Green
Both Columns are in Details section of Crystal Report and i have assigned
value to it using set data source property of Crystal (
rpt.SetDataSource(ds1.Tables[0]))
I have used
FieldObject field;
field = rpt.ReportDefinition.ReportObjects["TestResult1"] as FieldObject;
Font fo = new Font("Arial Black", 15F, FontStyle.Bold);
field.ApplyFont(fo);
field.Color = Color.Red;
But this gets applied to the whole column and not to a particular Row.
Please Help.
No comments:
Post a Comment