fastreport

FastReport问题集

删除回忆录丶 提交于 2020-01-03 04:29:25
---------------- 使用自定义函数 ---------------------------------------- Q: 我怎样添加我的自定义函数? A: 使用 TfrReport.OnUserFunction 事件. 这里有一个简单的例子: procedure TForm1.frReport1UserFunction(const Name: String; p1, p2, p3: Variant; var val: Variant); begin if AnsiCompareText(‘SUMTOSTR‘, Name) = 0 then val := My_Convertion_Routine(frParser.Calc(p1)); end; 然后,你就可以在报表(任何表达式或脚本)的任何地方使用 SumToStr 函数了。 Q: 但是它仅仅能工作在一个TfrReport组件中。可我想在任何地方(在所有的TfrReport组件中)使用的我的自定义函数? A: 使 OnUserFunction event 句柄作为所有组件的公用句柄。如果你不能做到这一点,你需要创建函数库: type TMyFunctionLibrary = class(TfrFunctionLibrary) public constructor Create; override;

FastReport问题整理

半城伤御伤魂 提交于 2020-01-03 04:29:06
部分来自网上,部分来自网友,部分来自Demo 如果有新的内容,会不断更新.. ======================================================================== 新版本 1.FastReport中如果访问报表中的对象? 可以使用FindObject方法。 TfrxMemoView(frxReport1.FindObject('memo1')).Text:='FastReport'; 2.FastReport中如何使用上下标? 设置frxmemoview.AllowHTMLTags := True;在Text输入如下 上标:mm<sup>2</sup> 下表:k<sub>6</sub> 举一反三,你还可以使用其他HTML标记。 3.FastReport中如何打印总页数? 设置两次报表后加入引号内内容 "第[Page#]页 共[TotalPages#]页" 4.FastReport中如何动态加入变量及变量组? 建立变量组名 frxreport1.Variables.Add.Name:=' '+变量组名; 建立变量名 frxreport1.Variables.AddVariable('组名,如果为不存的组或空,则为默认组,这里不需要 空格',变量名,变量初始值); 例如要建立变量组Yuan,二个变量Yuan1,Yuan2,则为

FastReport几个使用技巧

谁都会走 提交于 2020-01-03 04:28:47
FastReport几个使用技巧 1.FastReport中如何共用TFrxreport及TfrxDBDataSet 一个程序中,不管多么大的程序,只要打印或预览时是模式的,则完全可以共用一个TFrxreport 变量及几个TfrxDBDataSet。只不过,要注意完成一个报表程序的步骤,主要是下面几步 1)清除报表,得到一个全新的报表内容。   Frxreport1.clear。 2)设置要使用的TfrxDBDataSet的别名,如果不需要可以省略这一步,但一般最好不同的报表用不同的别名。   注意这一步要在加载报表文件之前,因为一般设计报表文件时已经包含了别名信息。   frxDBDataSet1.UserName:=别名; 3)加载报表或动态建立一个TfrxReportPage。   Frxreport1.LoadFromFile(报表文件的完整文件名); 4)关联TfrxDBDataSet与TDataset,并设置要使用哪些TfrxDBDataSet。   Frxreport1.DataSets.Clear;//先清除原来的数据集   frxDBDataSet1.DataSet:=dataset1;//关联Fastreport的组件与TDataset数据集。   Frxreport1.DataSets.Add(frxDBDataSet1);/

FastReport(3)

旧时模样 提交于 2020-01-03 04:28:25
******使用脚本,脚本中使用变量 很多时候,我们希望把对报表的控制放到报表的脚本中,通常我这样做有二个原因: 1)能够根据字段内容的变化而使用不同的设置,因为如果想在程序中实现这样功能,就不得不用自定义函数,函数的实现要放到程序中,函数可能需要传递很多参数,效率低下。 2)把不同报表的控制放到脚本中,可以实现报表的模块化,程序只是简单的设置数据集的关系,并加载硬盘上的报表文件,不同报表的不同实现方式,显示方式,均放到报表文件中,程序简洁,易维护,易升级。 当然,这样的缺点就是程序中加载报表时的数据集别名必须与设计报表时的别名一致。 脚本的使用与通常程序的使用并没有太多的区别,就是像正常的程序那样引用控件的名称即可。 但注意对变量的使用,需要把变量名或表达式用<>括起来。 实现打印分组的页数。基本的原理就是: 1)必须使用二遍报表,因为FS算总页数就是需要二遍报表的。 2)在第一遍报表中,在GroupBand打印前,动态的建立整数型数组变量,用以保存上一个分组的总页数。 3)在最后一遍报表时,需要显示分组页数的Tfrxmemoview取得数组中的数据,但最后一个分组不会有总数,可以通过总页数减去GroupBand事件中保存的页数来取得。 4)代码中处理了一页多组,及一组多页打印分组头的情况。可以看到这些特殊处理的代码说明。 5

FastReport报表设计(仔细看)

喜欢而已 提交于 2020-01-03 04:27:10
FastReport报表设计 2011-06-16 16:56:19 | 分类: 系统开发 | 举报 | 字号 订阅 下载LOFTER 我的照片书 | 目录 5.1 前言 5.2 基本概念及操作 5.3 报表设计与范例 5.4 常用功能及函数 5.5 报表设计常用技巧 5.1 前言 汽车业务管理系统(VBMS)使用FastReport3.0报表系统设计报表。 本文主要描述使用FastReport设计报表的基本概念、使用方法、设计技巧和范例,不是FastReport的用户手册因此并不针对每个细节进行阐述。立足于建立设计报表的概念和实用技巧范例的讲解,面对的是具有一定计算机操作水平的用户。 在VBMS中使用FastReport设计报表应该掌握以下知识: 1、 熟悉SQL语言,为设计报表准备数据源。 2、 掌握VBMS的数据结构,可参考相关资料。 3、 掌握FastReport报表的设计使用方法。 体系结构 学习报表设计前应当首先弄清楚VBMS系统与FastReport报表设计之间的关系。报表设计的目的是将VBMS数据库(Firebird1.5)中的数据按照需要的视图方式显示、统计出来,并且可以打印、导出。 VBMS数据库与VBMS管理系统以及FastReport报表设计之间的关系是: Firebird数据库系统是报表的数据源,它存储着客户的业务数据

How to add List view item into dataset in delphi?

北战南征 提交于 2019-12-25 03:14:14
问题 i am developing invoicing system in my application there is a listview, a fastreport, button.. when press the the button the report should show the all item in the report can anyone provide best solution for this? 回答1: From example PrintStringList from FastReport's Demos folder: var Button1: TButton; StringDS: TfrxUserDataSet; frxReport1: TfrxReport; StringList: TStringList; procedure TForm1.Button1Click(Sender: TObject); begin StringDS.RangeEnd := reCount; StringDS.RangeEndCount :=

How to deal with warnings/hints in third party libraries?

强颜欢笑 提交于 2019-12-23 22:44:03
问题 We use FastReport for report generation. Indeed, we pay for access to the source code. We are currently using the latest stable version of FastReport. And while it is stable enough for our production, whenever I compile I see this: [dcc32 Hint] fs_iinirtti.pas(369): H2443 Inline function 'TList.Remove' has not been expanded because unit 'System.Types' is not specified in USES list [dcc32 Hint] fs_iclassesrtti.pas(656): H2443 Inline function 'TList.Remove' has not been expanded because unit

How to change the fastreport layout in xe7

╄→尐↘猪︶ㄣ 提交于 2019-12-13 06:47:26
问题 I want to change the Layout or band in fast report depending upon the dataset value ,how can be this done in fastreport 5.0 AND I am using delphiXE7 If it's a car ticket I want to print car and if its bike I want to print the bike details ,My data set have values of all orders in which some orders may have car and bike tickets so , When I generate the report (report is the ticket for my application) based on the data set value if its car I want to show car images and if its bike different

Hide column in DB cross-tab for FastReport

假如想象 提交于 2019-12-13 02:19:22
问题 I've been trying to hide column from a DB cross-tab in FastReport when the column header Value is 14001 ; but is not work down syntax !!! My Report Here's the code: procedure DBCross2OnCalcWidth(ColumnIndex: Integer; ColumnValues: Variant;var Width: Extended); begin if (VarToStr(ColumnValues[0]) = '14001') then Width := 0; end; 回答1: Try add procedure trigged on print and collection HeaderValues[0] procedure DBCross2OnPrintColumnHeader(Memo: TfrxMemoView; HeaderIndexes, HeaderValues, Value:

Fast reports - bulleted text

拜拜、爱过 提交于 2019-12-12 00:45:43
问题 Is there a way you can have bulleted tekst in fast reports 4.13 ? I have a memo field which I would like to display bulleted. If not in fast reports are there any other delphi components that can do that ? 回答1: The RichText object ( TfrxRichView ) supports bulleted text. The question which may naturally raise up, is how to make that bulleted list from code. Well, that's quite easy. You just set the Numbering property of the current Paragraph for the inner RichEdit of the TfrxRichView object