如何使用c#按钮点击打印水晶报告 [英] how to print crystal report with button click using c#

查看:64
本文介绍了如何使用c#按钮点击打印水晶报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用按钮点击事件打印水晶报告应该如何处理c#??

i我正在使用webforms。

i want to print crystal report using button click event how should do thi process with c#??
i am using webforms .

推荐答案

尝试这种方式...



try this way ...

ReportDocument oDocument = new ReportDocument();
oDocument.Load(Application.StartupPath + "//ReportPath//ReportName.rpt");
oDocument.SetDataSource(new DataSet()); // Added report data as dataset.
            
crviewer.ReportSource = oDocument;
crviewer.PrintReport();


在你的按钮clcik中写下代码。



In your button clcik write below code.

crystalreport1 objReport1=new crystalreport1();
crystalreportviewer1.reportsource=objReport1;


这篇关于如何使用c#按钮点击打印水晶报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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