水晶报表:禁止打印高度模糊的字段 [英] Crystal Report: Suppress Hightligthed fields on print

查看:98
本文介绍了水晶报表:禁止打印高度模糊的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的报表,由用户预览(在第三方应用程序中),他们需要在报表中突出显示某些字段(足够简单),但是,当他们将报表打印到黑白激光打印机的这些字段必须不再突出显示。



任何人都知道该怎么做?

解决方案

这可以通过使用布尔数据类型的参数来完成,该参数将控制预览或打印模式下字段的外观。因此,例如在预览模式下,该参数将在打印模式下设置为 True False
在格式编辑器中,有一些选项可以更改字段的外观,例如其样式,颜色等,这取决于参数的值。



要找到格式编辑器,请右键单击该字段并选择Format Object。





在上图中,红色矩形显示了用于指定外观的按钮条件。



要突出显示一个字段,可以根据预览或打印模式更改其颜色。



首先创建一个参数并为其命名,例如AppearanceParam



在字段资源管理器中→右键单击参数字段→选择新建→在名称框中输入参数的名称,选择其类型为布尔值,然后单击确定。



单击格式右侧颜色右侧的[x + 2]按钮编辑器,然后在其中编写以下代码

 如果{?AppearanceParam} = true,则
crRed
else
crBlack

在预览或打印报告之前,可以通过编程方式控制参数的值。 / p>

I have a crystal report which is previewed by the users (in a third party application) and they need some fields in this report highlighted (simple enough), but when they print the report to the B&W laser printer those fields must not be highlighted anymore.

Anyone know how to do this?

解决方案

It can be done by using a parameter of boolean data type which will control the appearance of the fields in preview or print mode. So for example in preview mode the parameter will be set to True and False in print mode. In the format editor there are some options to change the appearance of a field like its style, color etc. which can depend on the value of a parameter.

To find the format editor right click on the field and choose Format Object.

In the above image, the red rectangle shows the buttons which let you specify the appearance conditions.

To highlight a field you can change its color based on the preview or print mode.

First create a parameter and name it for example AppearanceParam

In the Field Explorer → right click on Parameter Fields → choose New → write the name of the parameter in the name box, choose its type to be boolean and click OK.

Click on the [x+2] button which is on the right side of the color in the format editor and write the following code there

if {?AppearanceParam} = true then
    crRed
else
    crBlack

The value of the parameter can be controlled programmatically before previewing or printing the report.

这篇关于水晶报表:禁止打印高度模糊的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆