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. HTML5 canvas globalCompositeOperation绘图类型讲解

    我们总是将一个图形画在另一个之上,大多数情况下,这样是不够的.比如说,它这样受制于图形的绘制顺序.不过,我们可以利用 globalCompositeOperation 属性来改变这些做法.global ...

  2. 深入浅出OOP(五): C#访问修饰符(Public/Private/Protected/Internal/Sealed/Constants)

    访问修饰符(或者叫访问控制符)是面向对象语言的特性之一,用于对类.类成员函数.类成员变量进行访问控制.同时,访问控制符也是语法保留关键字,用于封装组件. Public, Private, Protec ...

  3. crossplatform---Nodejs in Visual Studio Code 06.新建Module

    1.开始 Node.js:https://nodejs.org 2.Moudle js编程中,由于大家可以直接在全局作用域中编写代码,使开发人员可以很容易的新建一个全局变量或这全局模块,这些全局变量或 ...

  4. Java集合——题目

    第一题 (Map)利用Map,完成下面的功能: 从命令行读入一个字符串,表示一个年份,输出该年的世界杯冠军是哪支球队.如果该 年没有举办世界杯,则输出:没有举办世界杯. 附:世界杯冠军以及对应的夺冠年 ...

  5. android: 通过内容提供器读取系统联系人

    读取系统联系人 由于我们之前一直使用的都是模拟器,电话簿里面并没有联系人存在,所以现在需要自 己手动添加几个,以便稍后进行读取.打开电话簿程序,界面如图 7.1 所示. 图   7.1 可以看到,目前 ...

  6. C#中的函数式编程

    在函数式编程中,可以把函数看作数据.函数也可以作为参数,函数还可以返回函数.比如,LINQ就是基于函数式编程的. 两个例子引出函数式编程 语句式编程可能这样写: string result; ) { ...

  7. 【转】兼容iOS 10 资料整理

    1.Notification(通知) 自从Notification被引入之后,苹果就不断的更新优化,但这些更新优化只是小打小闹,直至现在iOS 10开始真正的进行大改重构,这让开发者也体会到UserN ...

  8. 忘记hmailiserver邮件服务器后台登陆密码解决

    进入后台进行hmailiserver的相关设置,发现登陆密码忘记了,如下图:

  9. GTD时间管理(3)---时间特区图

    最近在网上看到一副时间特区图,想象非常深,特点想分享给大家. 从上图可以看出 说明一个人全天的状况 说明: 全天时段 状态 7:30-8:00 是处于起床,穿衣,刷牙,吃早餐 8:00-9:00 是处 ...

  10. FTP客户端上传下载Demo实现

    1.第一次感觉MS也有这么难用的MFC类: 2.CFtpFileFind类只能实例化一个,多个实例同时查找会出错(因此下载时不能递归),采用队列存储目录再依次下载: 3.本程序支持文件夹嵌套上传下载: ...