FastReport中国社区FastReport联系电话 联系电话:023-68661681

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

来源:   发布时间:2020-02-18   浏览:2733次

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

今天,我们将研究从ReportBuilder 19FastReport VCL 6的迁移。

让我们使用FastReport VCL 6.3中包含的更新的Converter来执行此操作,即使您没有在计算机上安装ReportBuilder 19,它也允许您转换模板。

转换器(ConverterQR2FR.pas)具有从ReportBuilder 19FastReport VCL 6的以下可转换组件列表,在下表中列出。

ReportBuilderFastReportDoneReportBuilderFastReportDone
TitleTfrxReportTitle+CheckBoxTfrxCheckBoxView+
HeaderTfrxPageHeader+DBTextTfrxMemoView+
DetailTfrxMasterData+DBMemoTfrxMemoView+
FooterTfrxPageFooter+DBRichTextTfrxRichView+
Summary--DBCalcTfrxMemoView+
PageSummary--DBImageTfrxPictureView+
MemoTfrxMemoView+DBBarCodeTfrxBarCodeView+
RichTextTfrxRichView+2D DBBarCodeTfrxBarcode2DView+
LabelTfrxMemoView+DBTeeChartTfrxChartView+
SystemVariableTfrxMemoView+DBCheckBoxTfrxCheckBoxView+
VariableTfrxMemoView+Region--
ImageTfrxPictureView+SubReport--
ShapeTfrxShapeView+CrossTabTfrxDBCrossView+
LineTfrxLineView+PageBreak--
TeeChartTfrxChartView+PaintBoxTfrxPictureView+
BarCodeTfrxBarCodeView+TableGridTfrxTableObject+
2D BarCodeTfrxBarcode2DView+Google MapTfrxMapView+

从ReportBuilder 19到FastReport VCL 6的转换。

选择*.rtm格式的ReportBuilder 19设计器的报表模板。

我们将制作一个简单的转换器,包括一个表单、一对组件和一个按钮。

执行以下操作列表:

1.创建一个新的应用程序(File -> New -> VCL Forms Application)。

2.在Uses子句中输入ConverterRB2FR

3.根据安装的组件,您可能需要从ConverterRB2FR.pas的Uses子句中删除以下块:

VCLTee.TeeProcs, VCLTee.TeEngine, VCLTee.Chart, VCLTee.Series, VCLTee.TeCanvas

frxChart, frxBDEComponents, frxIBXComponents

4.将以下组件拖放到表单中:

  • frxReport
  • OpenDialog
  • SaveDialog
  • Button
  • frxDesigner
教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

5.将此代码放在按钮的OnClick事件中:

代码:

procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
if frxReport1.LoadFromFile(OpenDialog1.FileName) then
if SaveDialog1.Execute then
frxReport1.SaveToFile(SaveDialog1.FileName);
frxReport1.LoadFromFile(SaveDialog1.FileName);
frxReport1.DesignReport();
end.

6.运行应用程序。

如果您正确执行了所有操作,则该应用程序将启动,并且您需要单击表单上的一个按钮。

然后将出现一个用于打开文件的对话框,以*.rtm格式打开ReportBuilder 19设计器的报表模板。

此后,将转换您的模板,如果成功完成,将在您面前出现一个用于保存模板的对话框,将其保存为*.fr3格式。

转换后的模板将在FastReport VCL设计器中自动打开,但请确保转换正确。

如果将DataSet附加到模板,则需要在构建报表时将其附加到FastReport VCL模板以正确显示数据。

转换ReportBuilder 19(*.rtm)的报表模板的示例
模板报表FastReport VCL 6(*.fr3)

下面,使用屏幕快照示例,我们将考虑*.dfm格式的Delphi格式的特定转换,该格式将TQuickRep对象包含到FastReport VCL报表模板中。

例如,让我们构建ReportBuilder模板raTutor0001.rtm

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6
教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

我们通过ADOConnection1,DataSource1ADOTable1ppDBPipeline1连接到它。

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

按着这些次序:

1.让我们运行简单的Converter。

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

2.按下测试Test按钮。

3.出现打开文件对话框时,打开模版ReportBuilder raTutor0001.rtm

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

4.然后等待模板转换完成,如果成功,您将看到一个对话框,用于保存模板,将其保存为*.fr3格式,例如raTutor0001.fr3

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

5.然后,转换后的模板将在FastReport VCL 6设计器中自动打开,并确保转换正确。

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

6.将frxReport1和frxDBDataset1组件拖放到窗体中

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

7.在frxDBDataset1组件中,将属性DataSource更改为DataSource1,将UserName更改为ppDBPipeline1。

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

8.现在,我们需要将保存的模板加载到FastReport VCL Designer中。双击FastReport VCL组件,然后在报表设计器中打开保存的模板“raTutor0001.fr3”。

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

9.转到FastReport VCL设计器报表→“数据”菜单,然后选择ppDBPipeline1数据集。

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6
教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

10.我们还需要将此DataSet绑定到数据段。因此,双击MasterDataBand并选择ppDBPipeline1数据集。

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

11.在FastReport VCL 6中生成报表。

教你如何快速又有趣地从ReportBuilder 19迁移到FastReport VCL 6

产品介绍 | 下载试用 | 优惠活动 | 在线客服

本站文章除注明转载外,均为本站原创或翻译
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:FastReport控件中文网 [https://www.fastreportcn.com/]
本文地址:https://www.fastreportcn.com/post/2699.html

相关产品: FastReport VCL,


联系我们
  • 重庆总部 023-68661681
购买
  • sales@evget.com
合作
  • business@evget.com


在线
客服
微信
QQ 电话
023-68661681
返回
顶部