使用FastReport Studio开发报表(一)

Fr报表是俄罗斯人开发的一套报表工具,我开始接触是在Delphi中,免费开源,报表生成可以使用设置好的模板,也可以在运行过程中由代码直接生成。使用模板报表在一定程度上解决了一个中国式报表的复杂性问题,如果用户使用感觉某一项不合适,可以在使用过程中对模板直接修改。国内有不少商业软件中就使用了此控件,尽管有些一直不承认。
现在的Fr已经升级为FastReport Studio,已经是一个商业的控件了,适用的开发环境不仅仅是Delphi及CB,也包括了VS,查了一下报价,价格不菲。下载了一个Demo版本后进行了测试,感觉不错,应该是最新版了吧,4.4.60。从官方下载的控件有限制,声称最多可显示5页,并有未注册的标记。
Fr报表的操作主要分为两大步:1、设置报表模板;2、在开发环境的代码中引用。我的开发环境为VS2005,使用C#,库文件为Oracle,仅做测试。所使用的表只有一个Grade,数据很少:


一、设置报表的模板
在安装完成下载的控件后,在开始菜单中,启动FastReport Studio的设计器。

在此窗口中,基本上所有的功能都显示出来。在本程序中,报表所需要的按钮只有两个,一个是Insert Band,另一个是Text Object,前者是在页面上划分区域,后者则是设置在区域中显示的数据。在一个页面上可划分为多个区域,如表头、页首、页尾、主数据、明细数据、合计区等,我在此页面上只分三个区:页的标题,显示标题及打印时间、页码等;页首,显示数据的字段名称;主数据区则显示从库中读取出的数据。设计完成后的页面如下图所示:

在此报表中的ReportTitle、PageHeader及MasterData均可在Insert Band中找到。

页面的总体设计如边距等和Word文档类似,显示的标题等控件则是Text Object了,如果是直接显示的文本,可直接双击此控件后输入,其它功能则要在双击后出现的窗口内选择,如行号Line#、页码Page#等。


在显示外部数据列时,输入的数据有固定的格式:
1、数据分为两部分,中间有圆点隔开,前面为数据集的名称,后面为字段名,字段名必须用双引号。
2、此数据必须用方括号,方括号的意思类似于变量。
在此报表中,程序调用时需要记住的三点:保存的报表名、所设置的数据集名及列名。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Current version ---------------------------- + Fixed preview tabs in custom preview control + Added Processing for TfrxSysMemoView [6.6.1 - 6.6.12] + [Lazarus] Added LazChart RTTI modules - Fixed bug when reports threads may stall inside IIS DLL (New synch threads mechanism for DLL). - [Lazarus] Fixed bug when TfrxBitBtnControl doesn't show glyph when run desigher from Lazarus IDE - [Lazarus] Fixed Toolbar in the report designer for scale larger than 100% - Syntax memo Drag and Drop DataTree insert text to mouse position - Syntax memo code completion disabled inside string 'Text' block - Fixed saving sizes; - Fixed scope of script variables in code completion; - Fixed var parameter in declaration for code completion + Added arrows left - right keys for filtration during Code completion * Code completion now replaces whole ident , not just insert new in cursor position * Code completion window now resizable - Fixed code completion bug for variables declared in group like : 'm1, m2, m3: TfrxView;' + Added helper for Fill casting AsBrushFill/AsGradientFill/AsGlassFill (TfrxCustomFill) + Added TfrxPostProcessor.ResetDuplicates - can reset duplicated from script + Added DrillState property to rtti (check how to use in 151.fr3 report) - [Lazarus] Fixed Map object de-serialization of points - [Lazarus] Fixed bug with preview PageCache wich causes wrong behavior in interactive reports * Interactive charts fix with zoom in preview * Added New "What's new" report * Improved few demo reports in MainDemo - Fixed RestoreDefaults behavior - Fixed bug when interactive events may fire before chart was filled - Fixed bug with TfrxMapGeodataLayer.MapDataSet in Map Editor dialog * [Lazarus] Optmized MaxiCode output - Fixed bug with Mercator property * [Lazarus] Fixed modal dialogs in preview under linux GTK - Fixed Detail report bug when rebuilds report using TfrxCustomPreview.Report (Collapse/expand drills). - Fixed bug with KeepHeader and ReprintOnNewPage in multi-column reports * [Lazarus] Optmized work with fonts inder Linux GTK + Added TfrxDesigner.OnAfterUpdateReport event - Fixed font charset for RTF export

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值