FastReport.net  打印设计功能非常强大,打印内容可以自己设计。数据源可以来至许多个表,打印设计后的表格数据是以二进制保存在数据库中的。

1.打印设计:

  private void DesignReport(object sender, EventArgs e)
{
DataSet ds = GetQuery();--数据源,就是你要打印的数据(可以有多个sql语句)
if (ds == null) return; FastReport.Report r = new FastReport.Report();
MemoryStream s = LoadStream();--取存在数据库中二进制表格数据
if (s != null)
r.Load(s); r.RegisterData(ds);
if (r.Prepare() == true)
{
FastReport.Design.StandardDesigner.DesignerForm d = new FastReport.Design.StandardDesigner.DesignerForm();
d.Designer.cmdSave.CustomAction += new EventHandler(SaveReport);--保存方法
d.Designer.AskSave = false;
d.Designer.Report = r;
d.ShowDialog();
d.Dispose();
}
}

  2.打印预览

public void PreviewReport(object sender, EventArgs e)
{
if (gridView1.RowCount == 0) return; DataSet ds = GetQuery();
if (ds == null) return; MemoryStream s = LoadStream();
if (s == null) return; r = new FastReport.Report();
r.Load(s);
r.RegisterData(ds);
r.Show();
}

  3.打印

       public void PrintReport(object sender, EventArgs e)
{
if (gridView1.RowCount == 0) return;
DataSet ds = GetQuery();
if (ds == null) return;
MemoryStream s = LoadStream();
if (s == null) return;
r = new FastReport.Report();
r.Load(s);
r.RegisterData(ds);
r.Print();
bPrint = true;
}

  开始我使用这个控件的时候觉得有点复杂,使用了之后其实很简单。就给2个参数:数据源和表单数据。

文件下载http://files.cnblogs.com/EntityFramework/FRNetDemo2010-NET4.0.zip

FastReport.net 使用记录的更多相关文章

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

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

  2. 用fastreport在进行多列打印时,默认是先行后列,如何改成先列后行排记录?

    例子程序中的6.fr3是在Page中设置 columns=2这样就是先行后列,7.fr3就是3列先列后行的例子 1     6 2     7 3     8 4     9 5     10 但如果 ...

  3. FastReport 使用说明

    FastReport TfrxReport 此为最主要的报表元件,一个 TfrxReport 元件组成一份报表.在设计时期,双击此 元件可打开报表设计器(Report Designer),此元件拥有所 ...

  4. FastReport 使用技巧篇

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

  5. FastReport经验

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

  6. FastReport报表控件使用技巧总结

    FastReport报表控件使用技巧总结 1.FastReport中如何访问报表中的对象? 可以使用FindObject方法. TfrxMemoView(frxReport1.FindObject(' ...

  7. Qt开发环境中使用报表控件FastReport遇到的一些问题(一)

    FastReport是一款优秀的报表控件,由俄罗斯开发,国内有代理商.Qt环境下可实现报表功能的还有一款叫NCReport,也是收费控件,比较来比较去还是觉得前者功能强点.网上讲解此控件在Qt中使用的 ...

  8. Fastreport使用经验(转)在Delphi程序中访问报表对象

    Fastreport使用经验(转) 在Delphi程序中访问报表对象 最基本的方法就是frxReport1.FindObject. 然后把返回的对象强制转换成它的类型,当然,在报表中必须真的有这么个东 ...

  9. 深入-FastReport TfrxReport组件使用

    [翻译] FastReport TfrxReport组件使用   一:加载和保存报表 报表默认保存在项目窗体文件中,大多数情况下,没有更多的操作要深圳市, 因此,你不需要采取特别措施来载入报告.如果你 ...

随机推荐

  1. dedecms 财付通接口

    用织梦做了个旅游网站,网址:http://www.redtourism.cn/ 客户要求财付通支付,上网找了下 不是要买就是要钱,只有自己写了. 代码: <?phpif(!defined('DE ...

  2. mysql之主从复制

    原理--> 在数据库层面,复制语句或者行,因为在数据库层面,故只有主服务器生成,并放到二进制日志里面,才能复制给从服务器. 原理--> mysql的主从复制基于异步,主要有三个进程执行,分 ...

  3. iOS GCD使用整理

    自己进行一个复习整理 1.最简单的用法 全局并行 dispatch_async(dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_ ...

  4. HDU 1180 诡异的楼梯(BFS)

    诡异的楼梯 Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status ...

  5. springMVC+ freemark多视图配置

    <!--通用视图解析器--> <bean id="viewResolverCommon" class="org.springframework.web. ...

  6. Linux合并iso

    http://blog.chinaunix.net/uid-20564848-id-74712.html http://www.yopoing.com/2008/01/windows_linux_un ...

  7. Qt之HTTP上传/下载(继承QNetworkAccessManager,包括使用了authenticationRequired认证信号)

    效果 QNetworkAccessManager DownloadNetworkManager::DownloadNetworkManager(QObject *parent) : QNetworkA ...

  8. mybatis第一个入门demo

    学习框架技术,一般先写个demo,先知道是什么,然后在知道为什么,这也是进步的一种. 源码链接:http://pan.baidu.com/s/1eQJ2wLG

  9. GetCurrentDirectory、SetCurrentDirectory和GetModuleFileName

    DWORD GetCurrentDirectory( DWORD nBufferLength, // size of directory buffer LPTSTR lpBuffer      // ...

  10. ZOJ 1008 Gnome Tetravex(DFS)

    Gnome Tetravex Time Limit: 10 Seconds      Memory Limit: 32768 KB Hart is engaged in playing an inte ...