如何在asp.net mvc3中使用crystal report视图 [英] how to use crystal report view in asp.net mvc3

查看:105
本文介绍了如何在asp.net mvc3中使用crystal report视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在asp.net使用水晶报告mvc3

解决方案

让我们试试吧。

http://code.msdn.microsoft.com/Using-Crystal-Report-in-bb0e6229 [ ^ ]


< blockquote>是的,您可以尝试使用 CrystalDecisions.CrystalReports跟踪



 。发动机; 

public ActionResult Report()
{
ReportClass rptH = new ReportClass();
rptH.FileName = Server.MapPath( [reportName] .rpt);
rptH.Load();
rptH.SetDataSource([datatable]);
Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
return 文件(流, application / PDF);
}







然而,根据专家的说法,水晶报告与MVC不兼容您也可以尝试以下替代



*为报告创建一个单独的目录

*为报告创建正常的ASPX页面





HTH


当然,看看这个男人



ASP.NET MVC和Crystal Reports [ ^ ]

can i use crystal report in asp.net mvc3

解决方案

let try here.
http://code.msdn.microsoft.com/Using-Crystal-Report-in-bb0e6229[^]


Yes you can try following

using CrystalDecisions.CrystalReports.Engine;

public ActionResult Report()
{
    ReportClass rptH = new ReportClass();
    rptH.FileName = Server.MapPath("[reportName].rpt");
    rptH.Load();
    rptH.SetDataSource([datatable]);
    Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
    return File(stream, "application/pdf");   
}




However, according to experts crystal reports does not work well with MVC so you can also try following alternate

* Create a seperate directory for reports
* Create normal ASPX pages for reports


HTH


Of course, look at this one man

ASP.NET MVC and Crystal Reports[^]


这篇关于如何在asp.net mvc3中使用crystal report视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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