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

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

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

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

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

让我们使用FastReport VCL 6.3中包含的更新的Converter来完成它,即使您没有在计算机上安装QuickReport 6,它也可以转换您的模板。

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

QuickReport 6FastReport VCL 6DoneQuickReport 6FastReport VCL 6Done
TQuickRepTfrxReportPage+TQRLineGraphTfrxChartView+
TQRPreviewController--TQRGrImage
TQRGrImage
TfrxPictureView
KeepAspectRatio:= true
+
TQuickAbstractRep--TQRPDFShape--
TQRSubDetail
TQRBand
TQRGroup
TfrxBand+TQRFramelineTfrxLineView+
TQRWildBand--TQRAbsTable--
TQRChildBandTfrxChild+TQRDBJPGlmageTfrxPictureView+
TQRLoopBandTfrxMasterData.RowCount+TQRPQuickrepTfrxReportPage+
TQRStringsBand--TQRPBandTfrxBand+
TQRLabel
TQRDBText
TQRExpr
TQRSysData
TQRMemo
TQRExprMemo
TfrxMemoView+TQRPChildBandTfrxChild+
TQRGraphicCanvasTfrxPictureView+TQRPLabelTfrxMemoView+
TQRMetriclabel--TQRPDBTextTfrxMemoView+
TQRHTMLLabelMemo allowHTMLTegs = true+TQRPDBlmageTfrxPictureView+
TQRDMBarcode
TQRDbDMBarcode
TfrxBarcode2DView
BarType := bcCodeDataMatrix
+
+
TQRPExprTfrxMemoView+
TQRQRBarcodeTfrxBarcode2DView+TQRPMemoTfrxMemoView+
TQRQRDBBarcodeTfrxBarcode2DView+TQRPRichtextTfrxRichView+
TQRRichText
TQRDBRichText
TfrxRichView+TQRPGrid--
TQRShapeTfrxShapeView+TQRPCheckBox--
TQRlmage
TQRDBlmage
TfrxPictureView+TQRPShapeTfrxShapeView+
TQRCompositeReport--TQRPExprCheckbox--
TQRXMLSSFilter--TQRStringgridReport--
TQRPreview--TQRGridReport--
TQRColorBox--TEnhancedlistbox--
TQRExpBarChart--

从QuickReport 6到FastReport VCL 6的转换。

选择*.dfm格式的Delphi格式,您可以在其中找到TQuickRep对象,并在其中构建我们需要的报表。或选择*.qr2格式的QuickReport 6设计器的报表模板。

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

执行以下操作列表:

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

2.在Uses子句中输入ConverterQR2FR

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

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

frxChart, frxBDEComponents, frxIBXComponents

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

  • frxReport
  • OpenDialog
  • SaveDialog
  • Button
  • frxDesigner
教你如何快速又有趣地从QuickReport 6迁移到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.运行应用程序。

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

然后将出现一个用于打开文件的对话框,打开*.dfm格式的必需Delphi格式,其中包含TQuickRep对象,或者以*.qr2格式打开QuickReport 6设计器的报表模板。

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

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

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

转换包含TQuickRep的Delphi表单(*.dfm)的示例
对象,以模板报表FastReport VCL 6(*.fr3)

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

例如,让我们在invform.dfm表单上构建QR模板。

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

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

按着这些次序:

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

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

2.按下测试Test按钮。

3.出现打开文件对话框时,打开表格Invform.dfm

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关产品: FastReport VCL,


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


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