FastReport使用心得

一、准备

  1、这次开发使用的是FastReport桌面版(FastReport.Net Version 201731.16 Demo)

  2、引用类库FastReport.dll、FastReport.Web.dll

二、桌面版制作报表

  1、添加数据源

    Report------Add Data Source------

    连接数据库,测试连接成功,选取数据表,字段自动带出到界面

    如果数据源中增加了额外的数据字段,需要注意字段的属性需要保持一致,Calculated属性设置为False

  2、画报表页面

    使用table,直接拖拽数据字段至指定位置即可

  3、报表文件的处理

    FastReport文件本质是XML形式的键值对,

    <Dirctionary></Dirctionary>标签下的<MsSqlDataConnection></MsSqlDataConnection>删除,注意是删除标签对。这里删除的原因是,我们是使用的是桌面版FastReport制作报表,但是是用网页版来调用文件,网页版只传DataSource给FastReport文件。

    <Dirctionary></Dirctionary>标签下的<TableDataSource>的属性需要调整,除了Name、TableName需要与提供的数据源的表名XXX对应外,还需要增加一个属性ReferenceName,值为XXX.XXX。

 三、Web程序调用文件

  用于展示报表的首页,使用ajax形式访问服务器获取数据并填充到页面内。  

  服务器数据准备

    数据查询,拼写SQL语句生成DataTable填充到DataSet中,注意表名需要与文件中的表名保持一致。

    设置报表样式,调用报表文件,并将数据填充到报表文件中。

    然后编写一个文件,将解析的结果填充到这个文件中,并将这个文件返回给展示报表的首页中。

<!DOCTYPE html>
<html lang="zh">
<head>
<title></title>
<meta content="width=device-width, initial-scale=1.0" name="viewport" /> @Html.Raw(ViewBag.CssFile)
@WebReportGlobals.Styles()
@WebReportGlobals.Scripts()
<style>
#frbody {
overflow: visible !important;
} .frtoolbar {
height: 70px !important;
background-image: none !important;
background-color: #fafafa !important;
} .refresh_button {
background-image: url(../../../../Content/img/刷新.png) !important;
background-position: center !important;
height: 52px !important;
width: 34px !important;
} .export_button {
background-image: url(../../../../Content/img/保存.png) !important;
background-position: center !important;
height: 52px !important;
width: 30px !important;
} .print_button {
background-image: url(../../../../Content/img/打印.png) !important;
background-position: center !important;
height: 52px !important;
width: 30px !important;
} .zoom_button {
background-image: url(../../../../Content/img/缩放.png) !important;
background-position: center !important;
height: 52px !important;
width: 30px !important;
} .first_button {
background-image: url(../../../../Content/img/首页.png) !important;
background-position: center !important;
height: 52px !important;
width: 30px !important;
} .prev_button {
background-image: url(../../../../Content/img/上一页.png) !important;
background-position: center !important;
height: 52px !important;
width: 41px !important;
} .next_button {
background-image: url(../../../../Content/img/下一页.png) !important;
background-position: center !important;
height: 52px !important;
width: 42px !important;
} .last_button {
background-image: url(../../../../Content/img/尾页.png) !important;
background-position: center !important;
height: 52px !important;
width: 30px !important;
}
</style>
</head>
<body class="fixed-top">
<div id="container" class="row-fluid">
<div id="body">
<div class="">
<div class="row-fluid">
<div class="span12">
<div class="widget box light-grey">
<div class="widget-title">
<div class="tools">
<a href="javascript:;" class="collapse"></a>
<a href="#widget-config" data-toggle="modal" class="config"></a>
<a href="javascript:;" class="reload"></a>
<a href="javascript:;" class="remove"></a>
</div>
</div>
<div class="widget-body">
@ViewBag.WebReport.GetHtml()
</div>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript"> </script> </body> </html>

    至此,工作完成。

  

FastReport使用教程的更多相关文章

  1. 教程-FastReport 的安装 心得

    由于要使用报表,所以下载了FastReport 4.7.91,由于是第一次安装和使用FastReport报表,所以在安装的时候走了点弯路.把心得写一下吧. 我是第安装第二遍才完全理解安装过程,也可以定 ...

  2. VS2010+QT4.8.5 +FastReport教程

    如需转载请标明出处:http://blog.csdn.net/itas109 採用QT 的QAxObject方式执行FastReport特别麻烦,并且无法在编译的时候知道代码是否正确,并且大部分的函数 ...

  3. FastReport快速安装教程

    安装后需要覆盖的文件全部复制到安装目录 替换后的安装目录 选中Recompile右键必须以管理员运行 看图选择 编译后,需要汉化的话看下图选择 怎么添加Library直接看图按顺序进行 选择insta ...

  4. uniGUI for C++ builder下如何利用FastReport实现数据记录本地打印

    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/dlboy2018/article/details/81040260 (中行雷威2018.7.14于杭 ...

  5. 使用FastReport.net 报表在网页上实现打印功能

    这些年的工作当中,最早是在8年前接触到FastReport这个报表工具,从名字上来看,直译过来就是快速报表,正所谓天下武功,唯快不破,FastReport报表早些年确实是制作报表的不二之选,8年前的工 ...

  6. Winforn中使用FastReport实现点击导出按钮PDF预览并弹出另存为对话框

    场景 FastReport安装包下载.安装.去除使用限制以及工具箱中添加控件: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/10 ...

  7. Winform中使用FastReport的PictureObject时通过代码设置图片源并使Image图片旋转90度

    场景 FastReport安装包下载.安装.去除使用限制以及工具箱中添加控件: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/10 ...

  8. FastReport的模板文件frx文件啊怎样打开并编辑修改

    场景 FastReport安装包下载.安装.去除使用限制以及工具箱中添加控件: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/10 ...

  9. Angular2入门系列教程7-HTTP(一)-使用Angular2自带的http进行网络请求

    上一篇:Angular2入门系列教程6-路由(二)-使用多层级路由并在在路由中传递复杂参数 感觉这篇不是很好写,因为涉及到网络请求,如果采用真实的网络请求,这个例子大家拿到手估计还要自己写一个web ...

随机推荐

  1. 多个nginx之间如何实现反向代理和负责均衡

    1)nginx反向代理: http {     upstream routeadmin {         ip_hash;         server 127.0.0.1:9201 weight= ...

  2. There is no Action mapped for namespace [/] and action name [TestAction] ass

    1.修改action的name值 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE strut ...

  3. [小试牛刀]部署在IDEA的JFinal 3.0 demo

    进入JFinal 极速开发市区:http://www.jfinal.com/ 如上图,点击右边的最新下载:JFinal 3.0 demo - 此过程跳过注册\登录过程, 进入到如下,下载 下载并解压到 ...

  4. python 安装opencv及问题解决

    正常安装模式 pip install opencv-python==3.4.5.20 pip install opencv-contrib-python==3.4.5.20 -i http://pyp ...

  5. CF9D How many trees? (dp)

    这题我想了好久 设 \(f_{i,j}\) 为 \(i\) 结点 \(<=j\) 的方案数 固定根,枚举左右子树,就有: \[f_{i,j}=\sum_{k=0}^{n-1}f_{k,j-1}* ...

  6. 2018-09-10-weekly

    Algorithm 删除链表的倒数第N个节点 What:给定一个链表,删除链表的倒数第 n 个节点,并且返回链表的头结点. How:这是一道典型的利用双指针法解题.首先让指针first指向头节点,然后 ...

  7. java.util.Date 与 java.sql.Date 相关知识点解析

    问:java.sql.Date 和 java.util.Date 有什么区别?   答:这两个类的区别是 java.sql.Date是针对 SQL 语句使用的,它只包含日期而没有时间部分,一般在读写数 ...

  8. Selenium-三种等待方式

    在UI自动化测试中,必然会遇到环境不稳定,网络慢的情况,这时如果不做任何处理的话,代码会由于没有找到元素而报错.这时我们就要用到wait,而在Selenium中,我们可以用到一共三种等待,每一种等待都 ...

  9. OC + RAC (八) 查看信号状态和跳过信号

    -(void)_test9{ /// RACCommand又叫命令 是用来收发数据的 监听按钮点击,网络请求.... RACCommand * command = [[RACCommand alloc ...

  10. MySql 的类型和Java的类型

    参考:https://www.cnblogs.com/jerrylz/p/5814460.html 类型名称 显示长度 数据库类型 JAVA类型 JDBC类型索引(int) 描述           ...