Migrating from QuickReport 6 to FastReport VCL is quick and fun

2020-02-05

icon QR to RB

Today we will look at migration from QuickReport 6 to FastReport VCL.

Let's do it with the updated Converter included in FastReport VCL, it allows you to convert your template, even without QuickReport 6 installed on your computer.

Converter (ConverterQR2FR.pas) has the following list of convertible components from QuickReport 6 to FastReport VCL, it is presented in the table below.

QuickReport 6

FastReport VCL

Done

QuickReport 6

FastReport VCL

Done

TQuickRep

TfrxReportPage

+

TQRLineGraph

TfrxChartView

+

TQRPreviewController

-

-

TQRGrImage
TQRGrDBImage

TfrxPictureView

KeepAspectRatio:= true

+

+

TQuickAbstractRep

-

-

TQRPDFShape

-

-

TQRSubDetail

TQRBand

TQRGroup

TfrxBand

+

TQRFrameline

TfrxLineView

+

TQRWildBand

-

-

TQRAbsTable

-

-

TQRChildBand

TfrxChild

+

TQRDBJPGlmage

TfrxPictureView

+

TQRLoopBand

TfrxMasterData.RowCount

+

TQRPQuickrep

TfrxReportPage

+

TQRStringsBand

-

-

TQRPBand

TfrxBand

+

TQRLabel

TQRDBText

TQRExpr

TQRSysData

TQRMemo

TQRExprMemo

TfrxMemoView

+

TQRPChildBand

TfrxChild

+

TQRGraphicCanvas

TfrxPictureView

+

TQRPLabel

TfrxMemoView

+

TQRMetriclabel

-

-

TQRPDBText

TfrxMemoView

+

TQRHTMLLabel

Memo allowHTMLTegs = true

+

TQRPDBlmage

TfrxPictureView

+

TQRDMBarcode

TQRDbDMBarcode

TfrxBarcode2DView

BarType := bcCodeDataMatrix

+

+

TQRPExpr

TfrxMemoView

+

TQRQRBarcode

TfrxBarcode2DView

+

TQRPMemo

TfrxMemoView

+

TQRQRDBBarcode

TfrxBarcode2DView

+

TQRPRichtext

TfrxRichView

+

TQRRichText
TQRDBRichText

TfrxRichView

+

TQRPGrid

-

-

TQRShape

TfrxShapeView

+

TQRPCheckBox

-

-

TQRlmage

TQRDBlmage

TfrxPictureView

+

TQRPShape

TfrxShapeView

+

TQRCompositeReport

-

-

TQRPExprCheckbox

-

-

TQRXMLSSFilter

-

-

TQRStringgridReport

-

-

TQRPreview

-

-

TQRGridReport

-

-

TQRColorBox

-

-

TEnhancedlistbox

-

-

TQRExpBarChart

-

-

 

 

 

 

The conversion from QuickReport 6 to FastReport VCL.

Select Delphi form of the *.dfm format, in which you can find TQuickRep object, in which the report we need is constructed. Or select report template of the QuickReport 6 designer in *.qr2 format.

Will make a simple converter consisting of a form, a pair of components and one button.

Perform the following list of actions:

     1. Create a new application (File -> New -> VCL Forms Application).

     2. Enter in Uses clause ConverterQR2FR.

     3. Depending on the installed components, you may need to remove the following blocks from the Uses clause in ConverterQR2FR.pas:

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

      frxChart, frxBDEComponents, frxIBXComponents

     4. Drop the following components to the form:

  • frxReport
  • OpenDialog
  • SaveDialog
  • Button
  • frxDesigner

screenshot 1 

     5. Place this code in the OnClick event of the button:

Code:

1
2
3
4
5
6
7
8
9
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. Run the application.

If you did everything correctly, the application will start, and you will need to click a button on the form.

Then a dialog box for opening a file will appear, open the required Delphi form of the *.dfm format, containing the TQuickRep object, or a report template for the QuickReport 6 designer in the *.qr2 format.

Then your template will be converted, if this was completed successfully, a dialog box for saving the template will appear in front of you, save it in *.fr3 format.

This converted template will automatically be opened in the FastReport VCL designer, but make sure that the conversion was correct.

If a DataSet was attached to your template, you will need to attach it to the FastReport VCL template to display the data correctly when building the report.

Example of converting Delphi form (*.dfm) containing TQuickRep object, to template report FastReport VCL (*.fr3)

Below, using the screenshots example, we will consider a specific conversion of the Delphi form of the *.dfm format, which contains the TQuickRep object into the FastReport VCL report template.

For example, let's build a QR template on the form invform.dfm.

screenshot 2

 

screenshot 3

We connect DataSet to it through ADOConnection1, DataSource1 and Table1.

Follow these steps:

     1. Let's run our simple Converter.

screenshot 4
     2. Press the Test button.
    
     3. When the open file dialog box appears, open the form Invform.dfm.
 
screenshot 5    
     4. Then wait for the conversion of your template. If it is successful, you will see a dialog box to save the template, save it in the format *.fr3, for example invform.fr3.
 
screenshot 6
 
     5. Then the converted template will automatically be opened in the FastReport VCL designer and make sure the conversion is correct.
 
screenshot 7
 
     6. Drop the frxReport1 and frxDBDataset1 components to the form
 
screenshot 8
 
     7. In the frxDBDataset1 component, change property DataSource to DataSource1 and UserName to ADOTable1.

screenshot 9
 
     8. Now we need to load the saved template into FastReport VCL Designer. Double-click the FastReport VCL component and open the saved template "invform.fr3" in the report designer.
 
screenshot 10
 
     9. Go to the FastReport VCL Designer Report → Data menu and select the ADOTable1 dataset.   
 
screenshot 11   screenshot 12
 
     10. We also need to bind this DataSet to the data band. Therefore, double-click the MasterDataBand and select the ADOTable1 dataset.
 
screenshot 13
 
     11. Build a report in FastReport VCL.
 
screenshot 14

 

 

 

November 26, 2024

Installing FastReport on .NET 8.0 and Creating a Simple Report

The purpose of this article is to explain step by step how to install FastReport on .NET 8.0 and how to create a simple report. Taking the reporting process from the beginning, it will show how to connect, design and view reports.
November 20, 2024

Localization and Language Switching in FastReport VCL

FastReport VCL supports 40 languages for interface localization and allows you to change the language on the fly through menus or code, without recompilation.
November 01, 2024

New Features of the FastReport VCL Editor

We are considering new features of the report editor: extension lines, highlighting of intersecting objects, updated report and data trees.
Fast Reports
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2024 Fast Reports Inc.