rdlc打印自动生成 [英] rdlc print auto generate
问题描述
我正在使用C#开发窗口应用程序。我正在使用reportviewer显示rdlc。我只需要执行以下操作:
I am developing the window application using C#. I am using the reportviewer to display rdlc. I just require following things:
1)。无需查看即可打印rdlc客户端将单击打印按钮,并且打印应进入系统默认打印机。
2)。如果系统默认打印机不可用/无法工作,则会提示您选择。
1). Print rdlc without viewing it Client will click on print button and print should go System default printer. 2). if System default printer is not available/working then it will prompt for alternative.
我不想使用xml文件
推荐答案
您需要做的就是将报告和数据加载到报告查看器中,然后将报告页面呈现到内存流列表中并使用此处的PrintDocument类作为示例进行打印链接。对于询问用户是否找不到默认打印机更改的部分
Here is what you need to do is load your report and data into the report viewer and then render the report pages into list of memory streams and print them using then PrintDocument Class here as an expample how it is done link. For the part where it asks the user if it doesn't find default printer change
if (!printDoc.PrinterSettings.IsValid)
{
throw new Exception("Error: cannot find the default printer.");
}
在 Print()$ c $中c>显示PrintDialog的方法供用户选择打印机。
in the Print()
method with the showing of PrintDialog for user to select printer.
这篇关于rdlc打印自动生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!