简体   繁体   English

Crystal Reports在C#中区分预览和打印以进行预打印表格打印

[英]Crystal Reports distinguish preview and print for pre-printed form printing in C#

I have developed the asp.net application in c# and I am using Crystal Reports 13. 我已经用c#开发了asp.net应用程序,并且正在使用Crystal Reports 13。

I have requirement like some report I have pre-printed page. 我有一些要求,例如我已经预打印了一些报告。 So when view the report it display the reports include the logo and border but when I click on print button it suppress the logo and border which are already in the pre-printed paper. 因此,当查看报告时,它会显示报告,其中包括徽标和边框,但是当我单击“打印”按钮时,它会隐藏已在预打印纸中的徽标和边框。

It's not the most elegant way, but the only way I have been able to make it work: 这不是最优雅的方法,而是我能够使其工作的唯一方法:

  1. Create a paramter (call it PrintOption) and set the default value to "False". 创建一个参数(称为PrintOption),并将默认值设置为“ False”。

  2. For every field you want to suppress, right-click on the field and click "Format Field" 对于要隐藏的每个字段,右键单击该字段,然后单击“设置字段格式”

  3. In the Common tab for the field enter a suppression formula ("x+2" symbol) 在该字段的“常用”选项卡中,输入抑制公式(“ x + 2”符号)

  4. Enter {?PrintOption} = True and save. 输入{?PrintOption} = True并保存。

Now when you run the report it will show logo's and borders and when you are about to print just change the parameter to True and it will suppress your logos and borders. 现在,当您运行报告时,它将显示徽标和边框,并且在您要打印时,只需将参数更改为True,它将取消徽标和边框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM