本文介绍了请帮助在MVC中使用水晶报告。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 大家好.. 我很难在MVC中使用水晶报告。 在asp中我们在aspx页面中使用如 < CR:CrystalReportViewer ID =CrystalReportViewer2runat =serverAutoDataBind =trueReportSourceID =CrystalReportSource1 /> < CR:CrystalReportSource ID =CrystalReportSource1runat =server> < report filename =crystalreport.rpt> 和aspx.cs页面 protected void Page_Load(object sender,EventArgs e) { ReportDocument reportdocument = new ReportDocument(); reportdocument.Load( Server.MapPath(CrystalReport.rpt)); CrystalReportViewer2.ReportSource = reportdocument; } 这里我得到输出...但是在MVC View页面的情况下我将如何创建CrystalReportViewer con控制器......所以在控制器中我可以像下面那样通过... ReportDocument rd = new ReportDocument(); rd。加载(Server.MapPath(〜/ Rpts /)+crystalreport.rpt); CrystalReportViewer1.ReportSource = rd; 返回View(); 但我在MVC视图页面中无法控制CrystalReportViewer .. 请帮我查找这个答案.. 提前谢谢... 解决方案 Hello everyone..I am feeling difficulty to use a crystal report in MVC.In asp we are using in aspx page like <CR:CrystalReportViewer ID="CrystalReportViewer2" runat="server" AutoDataBind="true" ReportSourceID="CrystalReportSource1" /> <CR:CrystalReportSource ID="CrystalReportSource1" runat="server"> <report filename="crystalreport.rpt"> and in aspx.cs page protected void Page_Load(object sender, EventArgs e) { ReportDocument reportdocument = new ReportDocument(); reportdocument.Load(Server.MapPath("CrystalReport.rpt")); CrystalReportViewer2.ReportSource = reportdocument; }here I am getting the output...but in case of MVC View page How I will create CrystalReportViewer control...so that in controller I can pass like below...ReportDocument rd = new ReportDocument(); rd.Load(Server.MapPath("~/Rpts/") + "crystalreport.rpt"); CrystalReportViewer1.ReportSource = rd; return View();But I am not getting any control of CrystalReportViewer in MVC view page.. please help me to findout this answer..Thanks in advance... 解决方案 这篇关于请帮助在MVC中使用水晶报告。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-11 02:39