Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Crystal Report列字体根据条件动态设置_C#_Crystal Reports 2008 - Fatal编程技术网

C# Crystal Report列字体根据条件动态设置

C# Crystal Report列字体根据条件动态设置,c#,crystal-reports-2008,C#,Crystal Reports 2008,我正在使用Crystal Report生成报告 我必须根据“Noramal Range”列设置“测试结果”列的字体大小和颜色 如果“测试结果”(12)在“正常范围”(12-13)的范围内,则 尺寸=15,颜色=红色 否则 尺寸=10,颜色=绿色 这两列都在Crystal Report的Details部分,我使用Crystal的set data source属性(rpt.SetDataSource(ds1.Tables[0])为其赋值 我用过 FieldObject field; field

我正在使用Crystal Report生成报告

我必须根据“Noramal Range”列设置“测试结果”列的字体大小和颜色

如果“测试结果”(12)在“正常范围”(12-13)的范围内,则

尺寸=15,颜色=红色

否则

尺寸=10,颜色=绿色

这两列都在Crystal Report的Details部分,我使用Crystal的set data source属性(rpt.SetDataSource(ds1.Tables[0])为其赋值

我用过

 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;
但这将应用于整个列,而不是特定的行


请提供帮助。

如果在详细信息部分应用了条件,则该属性将适用于详细信息部分中显示的所有记录,这是crystal reports的功能


在您的情况下,如果要对特定行进行任何格式化,则需要在条件中包含
Testname
列,以便限制格式化。

yogesh dada,handi fodayala ja,crystal report kay roj chaluch rahil。。。现在,我的孩子们已经长大成人了