Webconfig中配置

IIS6.0 <system.web> <httpHandlers> 下增加

<httpHandlers>
<add path="FastReport.Export.axd" verb="*" type="FastReport.Web.Handlers.WebExport"/>
</httpHandlers>

IIS7.0后  <system.webServer>  <handlers>

 <system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<remove name="FastReportHandler"/>
<add name="FastReportHandler" path="FastReport.Export.axd" verb="*" type="FastReport.Web.Handlers.WebExport" />
</handlers> <staticContent>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff" />
</staticContent> </system.webServer>

<system.web.webPages.razor>中增加节点

<add namespace="FastReport" />
<add namespace="FastReport.Web" />

在Rozor中代码

@{
ViewBag.Title = "Index";
}
@FastReport.Web.WebReportGlobals.ScriptsWOjQuery()
@FastReport.Web.WebReportGlobals.StylesWOjQuery()
<style >
.frtoolbar{
height:40px !important;
}
</style>
<div style="overflow:scroll;height:100%">
@ViewBag.WebReport.GetHtml()
</div>

Action代码

 public ActionResult Index()
{
SetReport();
webReport.Width = Unit.Percentage(); //
webReport.Height = Unit.Percentage();// ;
webReport.ToolbarIconsStyle = ToolbarIconsStyle.Red;
webReport.ToolbarStyle = ToolbarStyle.Small;
webReport.ShowExports = true;
webReport.ShowToolbar = true;
webReport.ShowZoomButton = true;
webReport.ShowPrint = true;
webReport.AutoHeight = true;
ViewBag.WebReport = webReport;
return View();
}
private void SetReport()
{
string report_path = GetReportPath();
var user = (User)HttpContext.Session[Common.Constants.USER_KEY];
webReport.Report.Load(report_path + "test2.frx");
webReport.Report.Parameters.FindByName("工号").Value = user.SysOperator.LoginName;
webReport.ToolbarIconsStyle = ToolbarIconsStyle.Black;
webReport.ShowExports = true;
webReport.ShowPrint = true;
ViewBag.WebReport = webReport;
}
private string GetReportPath()
{
string report_path = Config.ApplicationFolder;
using (XmlDocument xml = new XmlDocument())
{
xml.Load(@Server.MapPath("../../App_Data/fastReport.config"));
foreach (XmlItem item in xml.Root.Items)
if (item.Name == "Config")
foreach (XmlItem configitem in item.Items)
if (configitem.Name == "Reports")
report_path += configitem.GetProp("Path");
}
return report_path;
}

fastReport.config

<?xml version="1.0" encoding="utf-8" ?>
<Test>
<Config>
<Reports Path="\App_Data\report\"/>
</Config>
</Test>

FastReport设计

因为这里的数据源是存储过程并且用到了临时表,所有存储过程中需要增加

IF = BEGIN
SET FMTONLY OFF
END

否则提示#temp无效

这里是通过程序后台传递参数,所以要注意一下

1.

2.

3.

PS:还有一点需要强调,FastReport数据源可以直接加载,不需要后台传递DataSet也是可以加载的,但要保证存储过程的正确性

附上FastReport可用版本http://download.csdn.net/detail/anbylau2130/9608832

FastReport.Net在Rozor中的应用的更多相关文章

  1. FastReport 中添加二维码功能.(Delphi)

    http://www.cnblogs.com/fancycloud/archive/2011/07/24/2115240.html FastReport 中添加二维码功能.(Delphi)   在实际 ...

  2. FastReport调用Delphi中的自定义函数(人民币大写金额)mtm

    1. 在 FormCreate 中向FastReprot添加函数 (fPrint)窗口 procedure TfPrint.FormCreate(Sender: TObject); frxReport ...

  3. 使用FastReport打印二维码

    简单介绍一下该功能所在的项目背景:C#语言编写的WPF客户端应用程序,在“结账”模块中,打印出的收款小票上需要显示一个二维码,服务生拿着小票去找顾客,顾客可以选择现金.银行卡等普通支付方式,也可以直接 ...

  4. FastReport 使用技巧篇

    使用技巧篇 1.FastReport中如果访问报表中的对象?       可以使用FindObject方法.      TfrxMemoView(frxReport1.FindObject('memo ...

  5. FastReport经验

    FastReport经验 1.FastReport中如果访问报表中的对象? 可以使用FindObject方法. TfrxMemoView(frxReport1.FindObject(’memo1′)) ...

  6. FastReport问题整理(http://129.sqdj.gov.cn/?p=77)

    1.FastReport中如果访问报表中的对象?可以使用FindObject方法.TfrxMemoView(frxReport1.FindObject(’memo1′)).Text:=’FastRep ...

  7. FastReport使用技巧

    使用技巧篇 1.FastReport中如果访问报表中的对象?       可以使用FindObject方法.      TfrxMemoView(frxReport1.FindObject('memo ...

  8. FastReport的使用方法

    以下是我在网上收集的 这是FastReport的主控件.它包含了调入.保存.预览和打印报表的方法.每个TfrReport控件只能包含一个单独报表. TfrReport属性描 述 DataSet-联接到 ...

  9. FastReport问题整理(转)

    FastReport问题整理 博客分类: 软件开发   部分来自网上,部分来自网友,部分来自Demo如果有新的内容,会不断更新.. 更新历史: 2009-02-27 加入套打方案全攻略(原:jinzh ...

随机推荐

  1. 深入浅出OOP(二): 多态和继承(继承)

    本文是深入浅出OOP第二篇,主要说说继承的话题. 继承的介绍 在OOP中,继承有如下的定义: 继承是一种OOP的机制,用于派生继承预定义的类 在这个继承关系中,预定义的类是基类,新类是子类 继承常常用 ...

  2. paip.提升效率--调试--日志系统日志参数含义---python

    paip.提升效率--调试--日志系统日志参数含义---python #同时向控制台和文件输出日志 #日志参数含义 import logging log_format = '%(filename)s ...

  3. iOS开发-UITableView顶部图片下拉放大

    关于顶部图片下拉放大,在用户展示的个人中心显示用户个人头像信息,设置UITableView的headerView实现,UITableView继承自UIScrollView,同样的设置UIScrollV ...

  4. wicket基础应用(1)--使用wicket对表单中的数据进行验证

    作者:lhx1026 出处:http://lhx1026.iteye.com/ wicket基础应用(1)--使用wicket对表单中的数据进行验证 举个例子: 1.有一个Java文件SysCharg ...

  5. 指定的参数错误。Vim.Host.DiskPartitionInfo.-spec VSPHERE.LOCAL\Administrator WIN-DOPGQVRRU2C

    ESXI5.5 工作需要,最近在研究虚拟化的东西. 项目做分布式开发需要很多开发服务器,公司没钱只好拿一台之前使用的Dell的服务器做虚拟机.质询了一下公司IT部门,他们使用的是vmware的一套方案 ...

  6. IoC实践--用Unity实现MVC5.0的IoC控制反转方法

    在MVC中,控制器依赖于模型对数据进行处理,也可以说执行业务逻辑.我们可以使用依赖注入(DI)在控制层分离模型层,这边要用到Repository模式,在领域驱动设计(DDD)中,Repository翻 ...

  7. LPC43xx Dual-core or Multi-core configuration and JLink Debug

    Test access port (TAP) JTAG defines a TAP (Test access port). The TAP is a general-purpose port that ...

  8. 由1433端口入侵,浅谈sqlserver安全 (转)

    前几日笔者在家里的PC上安装了Windows7旗舰版的操作系统,顺便搭了sqlserver2008和vs2010的开发环境,本打算业余时 间可以方便开发.学习.可是不尽人意啊!用了不到两天,居然突然出 ...

  9. openCV_java 图像二值化

    较为常用的图像二值化方法有:1)全局固定阈值:2)局部自适应阈值:3)OTSU等. 局部自适应阈值则是根据像素的邻域块的像素值分布来确定该像素位置上的二值化阈值.这样做的好处在于每个像素位置处的二值化 ...

  10. Why数学图像生成工具

    该软件能够以给定的数学公式及算法生成各种绚烂的数学图像.软件中有两种生成图像的方法: (1)通过一种我自定义的脚本语言生成: 软件中定义一套简单易学的脚本语言,用于描述数学表达式.使用时需要先要将数学 ...