rdlc print auto generate

ⅰ亾dé卋堺 提交于 2019-12-08 09:10:45

问题


I am developing the window application using C#. I am using the reportviewer to display rdlc. I just require following things:

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.

i don't want to use xml file


回答1:


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.");
        }

in the Print()method with the showing of PrintDialog for user to select printer.



来源:https://stackoverflow.com/questions/6410099/rdlc-print-auto-generate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!