热线(9:00-18:00):13544706711
当前位置: 首页 > 教程技巧 > 

<<ABP框架>> 功能管理

时间: 2016/10/30 13:04:06

插件链接:


FastReport.Net软件地址:https://pan.baidu.com/s/1c2kNBVi

 

 

使用方法:

第一步:添加引用

 FastReport.Bars.dll

 FastReport.dll

 FastReport.Web.dll

  dll包:http://pan.baidu.com/s/1pKJwXoZ

第二部:配置config

1、View文件夹内配置web.config文件,添加两个引用



2、网站配置文件web.config添加节点httphandlers




iis6:

"FastReport.Export.axd" verb="*" type="FastReport.Web.Handlers.WebExport" />


iis7:

"FastReportHandler" path="FastReport.Export.axd" verb="*" type="FastReport.Web.Handlers.WebExport"/>


配置config





 

第三部:控制器代码

1、视图




@WebReportGlobals.Scripts()
@WebReportGlobals.Styles()
@ViewBag.WebReport.GetHtml()


视图




2、控制器




private WebReport webReport = new WebReport();
public ActionResult Index()
{
  SetReport();

  webReport.Width
= 600;
  webReport.Height
= 800;
  webReport.ToolbarIconsStyle
= ToolbarIconsStyle.Black;
  ViewBag.WebReport
= webReport;
  
return View();
}
private void SetReport()
{
  
string report_path = AppDomain.CurrentDomain.BaseDirectory;
  
//传递数据
  webReport.Report.RegisterData(new List<object> { new { Type = "Type", Mobile = "mobile", Price = "price", Date = "date", Title = "title", Ad = "ad" } }, "Orders");
  
//调用模板
  webReport.Report.Load(report_path + "order.frx");
}


控制器




  




 

 

错误:

FastReport报表加载不出来并且报404错误:




 


 


解决方案:

当前项目->属性->Web->服务器->选中单选【使用Visual Studio 开发服务器】