在水晶报表中直接打印而在vs 2008中没有显示很多弹出窗口 [英] direct print in crystal report without showing many popup in vs 2008

查看:86
本文介绍了在水晶报表中直接打印而在vs 2008中没有显示很多弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好..
我正在做一个项目,正在创建水晶报表.
我必须打印报告.
当我按报表上的打印图标时,将弹出1个弹出窗口,当我在此页面上按确定"时,它要求我选择所有页面或选择页面范围,然后打开pdf文件中的转发,然后单击打印"按钮在pdf上,然后打印出来.

我希望当用户单击报告时没有任何进一步的弹出窗口时,应该出现打印",如果不可能,则在出现第一个弹出式打印提示后出现.我不希望该用户看到该pdf文件..

而且我还没有编写任何打印代码.

还有
我尝试通过从ActiveX和PDF更改ReportViewer控件PrintMode进行尝试,但是没有任何效果.
您是否还有其他想法可以解决此问题..

我也尝试过使用此

Hi all..
I am working on a project and I am creating crystal reports.
I have to print the reports.
When I press the print icon on the report , 1 pop opens and it asks me to choose all pages or select page range when I press on "Ok" on this page it then opens the repost in pdf file and then I click on print button on pdf and then print comes.

I want that when User click on report then without any further popup the Print should come and if it is not possible then after 1st popup print shud come. I dont want that User shud see the pdf file..

and I have not written any code for printing..

and also
I have tried by changing the ReportViewer control PrintMode from ActiveX and PDF but nothing works.
Do u have any other Idea how to solve this problem..

I have also tried by using this

reportDocument.PrintToPrinter(1, false, 1, 1);


但没有任何效果.
任何人都可以帮我这个忙吗?

在此先感谢...


but nothing works.
Can any body help me in this please...

Thanks in advance...

推荐答案

弹出的窗口是Windows的标准打印对话框.
将其打印为PDF的原因可能是因为您有pdf创建者作为标准打印机.

使用Crystal Report Viewer中的打印"按钮时,无论代码执行什么操作都无关紧要,它始终会显示一个打印"对话框,您必须在其中选择打印机并设置选项.

但是,您可以做的是在屏幕上放置一个按钮,将报告直接打印到打印机.
但是,这需要您具有printersettings和pagesettings对象.

如果使用给定的变量调用方法"printtoprinter",则报告将打印到标准打印机.

您可以使用(打印机设置,页面设置,布尔值)调用相同的方法.
我们做到的方式是.给用户一个屏幕,他可以在其中为程序中的每个报告设置打印机设置和页面设置.然后将那些对象序列化为文本文件并保存在网络共享上. (重要:序列化为文本不要将其保存在数据库中,因为您将丢失数据,并且打印不适用于所有打印机)
然后,让用户选择要打印到的位置:屏幕或打印机.
如果选择了打印机,则从文本文件中反序列化对象,然后调用printtoprinter方法.

这不是一件容易的事,但有可能.
The popup you get is the standard print dialog from windows.
The reason it is printing to PDF is probably because you have a pdf creator as your standard printer.

Whatever you do in code doesn''t matter when you use the print button from the crystal report viewer, it will always show a print dialog where you have to select you printer and set you options.

What you can do however is place a button on the screen that will print the report directly to printer.
This however requires that you have a printersettings and pagesettings object to do so.

If you call the method ''printtoprinter'' with the variables you gave, the report will print to you standard printer.

You can call the same method with (printersettings, pagesettings, boolean).
The way we did it is. Give the user a screen where he can set the printersettings and pagesettings for each report in the program. Those objects are then serialized to a text file and saved on a network share. (Important: serialize to text don''t save it in a database because you will lose data and the printing won''t work for all printers)
Then give the user the choice of where he wants to print to: screen or printer.
If printer is selected then deserialize the objects from the text files and call the printtoprinter method.

This isn''t a easy task but is possible.


这篇关于在水晶报表中直接打印而在vs 2008中没有显示很多弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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