FAQ

Licensing issues FastReport .NET Online Designer FastReport VCL Reporting FMX Analysis VCL

FastReport VCL

Do you provide technical support for FastReport VCL?

Yes, for customers with an active subscription

Do you have a Technical Support Statement?

Yes, you can find at: Technical Support Statement

Where can I contact FastReport VCL technical support?

Users can send requests via email to support@fast-report.com, through the request form on the website from the client panel, or via online chat

Is there a paid enhancement to the FastReport VCL functionality?

Yes, on a contractual basis.

Do I need to attach a FastReport VCL license file to my product under development?

Registration of a single software license gives you the right to write and compile your own application programs that use the software contained in the Product. All copies of the software that you write and distribute must indicate the Licensor's copyright. You can find more information in the license agreement.

Please explain in detail what is the difference between the main types of licensing?

Basically, our products have three types of licensing: Single License for one seat (for one developer). Team License – 4 seats. Additionally, it includes a license for the Build server. Site License – an unlimited number of seats registered at the same geographical address. Additionally, it includes a license for the Build server.

How much does it cost to renew FastReport VCL licensing? And what will I get from it?

You can renew your licensing in your control panel. Renewals include technical support and product updates. It is available at 1/2 of the full price per year. When your license has expired, you have two options: - Renew your license. This will allow you to receive technical support and product updates. - Continue to use FastReport VCL. In this case, you will not be able to use the latest product updates and receive technical support.

Is it possible to use FastReport VCL on the server?

Yes, on a Windows server if you are using Embarcadero's IDE or if you are using Lazarus, on a Windows server with Linux (multithreading limitations), FastReport VCL, starting with the Enterprise version, includes a set of server components

Which IDE versions does FastReport VCL support?

With the release of FastReport VCL 2023.2, only IDEs from Delphi 2010 to the most recent versions are supported.

How do I use FastReport VCL in multiple threads?

Before running the report, you need to set: TfrxReport.EngineOptions.EnableThreadSafe := True; TfrxReport.EngineOptions.SilentMode := True;

How do I disable the use of the global dataset list when using TfrxReport in a thread?

By default, FR uses a global list of datasets that is initialized in the frxClass module, when an instance of TfrxDBDataset is created, it is added to this list. In this regard, it is not possible to use datasets with the same names (even in different threads). To use a local list of datasets, you need to use the following code (starting from version 4.5.46): frxReport.EngineOptions.UseGlobalDataSetList := False; frxReport.EnabledDataSets.Clear(); frxReport.EnabledDataSets.Add(frxDataSet); frxReport.LoadFromFile(ReportName);

In a report, I need to fit text into a fixed-width TfrxMemoView by decreasing the font size. How to implement it?

Use the TfrxMemoView.CalcWidth function in the handler

TfrxMemoView.OnAfterData: procedure Memo1OnAfterData(Sender: TfrxComponent); begin Memo1.Font.Size:=10; if Memo1.CalcWidth>Memo1.Width-Memo1.GapX*2 then Memo1.Font.Size:=Trunc(Memo1.Font.Size*((Memo1.Width-Memo1.GapX*2)/Memo1.CalcWidth)); end;

Can I dynamically change the localization of the designer and the preview window?

Make the language file a mkall.bat utility (located in the language directory) and include the language dynamically:

uses frxRes;
frxResources.LoadFromFile('english.xml');

How can you migrate an array of variables from Delphi to FR?

Use this code: var a: variant; begin a := VarArrayOf([1,2,3]); frxReport1.Script.Variables['a'] := a; end;

How can you code dataset navigation that is connected to a report but not connected to any band in the report script?

Use this code: var DS: TfrxDataSet; begin DS:=Report.GetDataset('Items'); DS.First; while not DS.Eof do begin ShowMessage(DS.Value('Part Name')); DS.NEXT; end; end.

How do I convert reports from Report Builder to Fast Report?

Add the ConverterRB2FR module to the uses section. In run-time, in the Fast Report designer, you will be able to open Report Builder reports and resave them in the Fast Report format.

In the script, I'm trying to set boundaries for Memo: Memo1.Frame.Typ := [ftLeft, ftRight, ftTop, ftBottom]. I get an error.

The Fast Report script does not support multiples. You need to do this: Memo1.Frame.Typ := ftLeft + ftRight + ftTop + ftBottom;

When the project is being compiled, the following message is displayed 'Class TfrxButtonControl not found' (TfrxRichView, TfrxCrossView, TfrxOLEView,TfrxBarCodeView, TfrxCheckBoxView, TfrxGradientView, TfrxChartView, TfrxADOQuery etc.).

Add TfrxDialogControls (TfrxRichObject, TfrxCrossObject, TfrxOLEObject, TfrxBarCodeObject, TfrxCheckBoxObject, TfrxGradientObject, frxChartObject, TfrxADOComponents etc) to the report from the Fast Report Component palette or add frxDCtrl, frxRich, frxCross, frxOLE, frxBarcode, frxChBox, frxGradient, frxChart, frxADOComponents modules to the uses section.

How to insert your report name in the preview title?

To insert your report name in the title, run: frxReport1.ReportOptions.Name := 'My report';

I have lost the object inspector in the report designer (data tree, standard toolbar)

In the designer, go to the View|Settings menu and click the Restore Settings button

How can I put the latest record from the database on a separate page?

procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
begin
 if MasterData1.DataSet.RecNo = MasterData1.DataSet.RecordCount-1 then Engine.NewPage;
end;

How do I convert reports from QuickReport to Fast Report?

Add the ConverterQR2FR module to the uses section and: conv := TConverterQr2Fr.Create; conv.Source := QuickRep1; conv.Target := FReport; conv.Convert; FReport.SaveToFile('converted_fromQR.fr3');

In the preview, the text displayed in TfrxMemoView is different from TfrxRichView, even though the font type and size are the same.

Set the TfrxRichView.Wysiwyg property to False.

After closing the preview window, Delphi fails to retrieve the values of the report variables

Before generating the report, add: frxReport1.EngineOptions.DestroyForms:=False;

How to load an RTF file in a script into TfrxRichView component?

Use this code: Rich1.RichEdit.Lines.LoadFromFile()

How do I stop building a report?

Use this code: frxReport1.Engine.StopReport;

How to display columns not from top to bottom, but from left to right?

If you set the number of columns for a page, then the entries will be displayed from bottom to top, and if you set the number of columns for a band, then from left to right.

How can I add a button to the preview window?

Use this code: ``` uses frxClass, frxPreview, ComCtrls, ToolWin, Buttons; ... procedure TForm1.ButtonClick(Sender: TObject); begin ShowMessage('My Button pressed'); end;

procedure TForm1.frxReport1Preview(Sender: TObject); var Button: TSpeedButton; begin // Add a new button Button := TSpeedButton.Create(TfrxPreviewForm(frxReport1.PreviewForm).ToolBar); Button.Parent:=TfrxPreviewForm(frxReport1.PreviewForm).ToolBar; Button.Caption:='My Button'; Button.Width:=60; Button.Left:=650; // New button handler Button.OnClick:=ButtonClick; end; ```

You can also add a button to the standard Preview not from the OnPreview event, but from the OnEndDoc event. This option is useful for two cases: 1) When the handler of this button does something with the preview data. In this case, it is undesirable to create the button from OnPreview, as it will be active even during report generation. 2) When the additional button should appear under certain conditions, which are set in the pre-print dialog (frxDialogPage).

++++++++++++ For PDF Export Button

uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, frxClass, frxExportPDF, frxPreview, frxDsgnIntf, Menus;
type TForm1 = class(TForm)
    frxReport1: TfrxReport;
    frxPDFExport1: TfrxPDFExport;
    SaveDialog1: TSaveDialog;
    procedure FormCreate(Sender: TObject);
    procedure frxReport1Preview(Sender: TObject);
    procedure PDFExport(Sender: TObject);
    private { Private declarations }
    public { Public declarations }
end;

var Form1: TForm1;

implementation {$R *.dfm}

procedure TForm1.PDFExport(Sender: TObject);
begin
    if SaveDialog1.Execute then
    begin frxPDFExport1.FileName:=SaveDialog1.FileName;
        TfrxPreview(frxReport1.Preview).Export(frxPDFExport1);
    end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
    frxReport1.ShowReport;
end;
procedure TForm1.frxReport1Preview(Sender: TObject);
var i, j, mi: integer;
begin
        TfrxPreviewForm(frxReport1.PreviewForm).PdfB.OnClick:=PDFExport;
    for i := 0 to frxExportFilters.Count - 1 do
    begin
    if TfrxCustomExportFilter(frxExportFilters[i].Filter).ClassName = 'TfrxPDFExport' then
        mi:=i;
    end;
    TfrxPreviewForm(frxReport1.PreviewForm).ExportPopup.Items[mi].OnClick:=PDFExport;
    for i:=0 to TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items.Count-1   do
    begin
        if   TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i].Caption=TfrxPreviewForm(frxReport1.PreviewForm).ExportB.Hint then
        begin
            for j:=0 to   TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i].Count-1 do
            if TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i][j].Caption=TfrxPreviewForm(frxReport1.PreviewForm).ExportPopup.Items[mi].Caption then
TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i][j].OnClick:=PDFExport;
end;
        if TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i].Caption=TfrxPreviewForm(frxReport1.PreviewForm).PdfB.Hint then
    TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[i].OnClick:=PDFExport;
        end;
    end;
end.

There is a list of reports. For preview, when selecting a report, you need to show the user only the first page of the report. How to do it?

Use the code ``` procedure TForm1.frxReport1Progress(Sender: TfrxReport; ProgressType: TfrxProgressType; Progress: Integer;) begin if Progress > 1 then frxReport1.Engine.StopReport; end;

procedure TForm1.Button1Click(Sender: TObject); begin frxReport1.PrepareReport(); while frxReport1.PreviewPages.Count > 1 do frxReport1.PreviewPages.DeletePage(1); frxReport1.ShowPreparedReport; end; ```

The TfrxPreview component does not have a button panel similar to the one in the standard preview window. Is it possible to create your own panel similar to the standard one?

Of course, you can. You can create a panel with buttons and use the following TfrxPreview methods for each frxPreview1.Print button; frxPreview1.LoadFromFile; frxPreview1.SaveToFile; frxPreview1.Export(Filter); frxPreview1.Find; frxPreview1.Zoom:=frxPreview1.Zoom + 0.25; frxPreview1.Zoom:=frxPreview1.Zoom - 0.25; frxPreview1.OutlineVisible := frxPreview1.OutlineVisible; frxPreview1.ThumbnailVisible:=not frxPreview1.ThumbnailVisible; frxPreview1.PageSetupDlg; frxPreview1.Edit; frxPreview1.First; frxPreview1.Prior; frxPreview1.PageNo := 1; frxPreview1.Next; frxPreview1.Last;

How to implement editing of TfrxRichView and TfrxPictureView in the preview window using the standard TfrxRichView and TfrxPictureView editing dialog boxes?

Use the code ``` uses frxRich, frxRichEditor, frxDesgn;

procedure TForm1.frxReport1ClickObject(Sender: TfrxView; Button: TMouseButton; Shift: TShiftState; var Modified: Boolean); begin if Sender is TfrxRichView then with TfrxRichEditorForm.Create(Form1) do begin RichView := TfrxRichView(Sender); Modified := ShowModal = mrOk; Free; end; end;

uses frxDesgn, frxEditPicture;

procedure TForm1.frxReport1ClickObject(Sender: TfrxView; Button: TMouseButton; Shift: TShiftState; var Modified: Boolean); begin if Sender is TfrxPictureView then with TfrxPictureEditorForm.Create(Form1) do begin Image.Picture.Assign(TfrxPictureView(Sender).Picture); Modified := ShowModal = mrOk; if Modified then TfrxPictureView(Sender).Picture.Assign(Image.Picture); Free; end; end; ```

How do I hide a menu button in the designer?

Similar to the preview window: ``` procedure TForm1.frxDesigner1Show(Sender: TObject); begin if Sender is TfrxDesignerForm then begin TfrxDesignerForm(Sender).OpenB.Visible := False; end; end;

procedure TForm1.frxDesigner1Show(Sender: TObject); var i: integer; begin if Sender is TfrxDesignerForm then begin for i:=0 to TfrxDesignerForm(Sender).ObjectsTB1.ButtonCount-1 do if TfrxDesignerForm(Sender).ObjectsTB1.Buttons[i].ImageIndex in [30, 32] then //the COPY APPEARANCE and SERVICE TEXT buttons are hidden TfrxDesignerForm(Sender).ObjectsTB1.Buttons[i].Visible:=False; TfrxDesignerForm(Sender).DataTree.FunctionsTree.Visible:=False; TfrxDesignerForm(Sender).DataTree.ClassesTree.Visible:=False; end; end; ```

In the designer, the text in the memo is unreadable when typing text in a memo with a font size set to 6 pt.

In the designer, go to the View|Settings menu and uncheck the Use object font option

The colors in the band titles disappeared. What to do?

Enable the "Show band titles" option in the designer in the View-Settings menu

I have created a report using Wizard. Now I can't change the color, font of the report elements

Wizard created the report using styles. You need to either change the appropriate style or clear the style of the object

How can I change the paper type when printing a report?

You can access all fields of the DEVMODE structure in the OnPrintPage event. For example, to change the DM_MEDIATYPE field, you can use the following code (and similarly for other fields): ``` uses frxprinter;

procedure frxReport1PrintPage(Page: TfrxReportPage; CopyNo: Integer); procedure ChangeMediaType(mType: Integer); begin if frxPrinters.Printer is TfrxPrinter then with TfrxPrinter(frxPrinters.Printer) do begin DeviceMode.dmFields := DeviceMode.dmFields or DMMEDIATYPE; DeviceMode.dmMediaType := mType; SetPrintParams(Page.PaperSize, Page.PaperWidth, Page.PaperHeight, Page.Orientation, Page.Bin, Integer(Page.Duplex), frxReport1.PrintOptions.Copies); end; end; begin if idx = 0 then ChangeMediaType(DMMEDIATRANSPARENCY) else if idx = 1 then ChangeMediaType(DMMEDIAGLOSSY) else ChangeMediaType(DMMEDIASTANDARD); inc(idx); end; ```

How do I change the connect string for TfrxADODataBase to avoid getting an error message if the user's connect string is different from the connect string set by the developer in the report template?

To implement this functionality, you need to disable the connection when loading a report in the TfrxReport.OnBeforeConnect event ``` var Form1: TForm1; Connect: Boolean;

implementation {$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject); begin Connect:=False; frxReport1.LoadFromFile('C:\test.fr3'); Connect:=True; TfrxADODataBase(frxReport1.FindObject('ADODatabase1')).Connected := False; TfrxADODataBase(frxReport1.FindObject('ADODatabase1')).DatabaseName := 'Provider=Microsoft.Jet.OLEDB.4.0; User ID=Admin; Data Source=C:\Program Files\FastReports\FastReport 4\Demos\Main\demo.mdb'; TfrxADODataBase(frxReport1.FindObject('ADODatabase1')).Connected := True; frxReport1.ShowReport(); end;

procedure TForm1.frxReport1BeforeConnect(Sender: TfrxCustomDatabase; var Connected: Boolean); begin if not Connect then Connected:=False; end; ```

Can I add text (such as a watermark) to pages that have already been formed?

You can add text as a preview in the TfrxReport.OnEndDoc event procedure TForm1.frxReport1EndDoc(Sender: TObject); var p: TfrxReportPage; m: TfrxMemoView; i: integer; begin frxReport1.Preview.Lock; for i := 0 to frxReport1.PreviewPages.Count - 1 do begin p:=TfrxReportPage(frxReport1.PreviewPages.Page[i]); m:=TfrxMemoView.Create(p); m.CreateUniqueName; m.SetBounds(0, 0, (p.PaperWidth - p.RightMargin - p.LeftMargin) * fr01cm, (p.PaperHeight - p.TopMargin - p.BottomMargin) * fr01cm); m.Text := 'Demo'; m.Rotation := 45; m.Font.Size := 128; m.VAlign := vaCenter; m.HAlign := haCenter; frxReport1.PreviewPages.ModifyPage(i,p); end; frxReport1.Preview.UnLock; end; //and before directly printing a page in an event TfrxReport.OnPrintPage procedure TForm1.frxReport1PrintPage(Page: TfrxReportPage; CopyNo: Integer); var m: TfrxMemoView; begin m:=TfrxMemoView.Create(page); m.CreateUniqueName; m.SetBounds(0, 0, (page.PaperWidth - page.RightMargin - page.LeftMargin) * fr01cm, (page.PaperHeight - page.TopMargin - page.BottomMargin) * fr01cm); m.Text := 'Demo'; m.Rotation := 45; m.Font.Size := 128; m.VAlign := vaCenter; m.HAlign := haCenter; end;

Two TfrxReportPage objects are generated in the report. On the first page, data for the front side of the sheet is printed, and on the second page, data for the back side is printed. For duplex printing, it is necessary to print the front and back sides alternately. How can this be implemented?

You can re-sort the preview pages after the report is generated: var i, j: integer; page : TfrxReportPage; begin frxReport1.PrepareReport(); j := frxReport1.PreviewPages.Count div 2; page := TfrxReportPage.Create(nil); for i := 0 to j - 2 do begin page.AssignAll(frxReport1.PreviewPages.Page[j + i]); frxReport1.PreviewPages.AddEmptyPage(i * 2 + 1); frxReport1.PreviewPages.ModifyPage(i * 2 + 1, page); frxReport1.PreviewPages.DeletePage(j + i + 1); end; page.Free; frxReport1.ShowPreparedReport; end;

I cannot change the connection parameters for the ADODataBase in the script, and the application shows an error "Operation is not allowed because object is open." It was possible in version 3. How can I resolve the issue of changing the database connection details?

Try setting ADODataBase.Connected=False before changing the connection settings, and then reconnect

How do I programmatically hide a column in DBCrossView?

Try just setting the width=0 procedure Cross1OnCalcWidth(ColumnIndex: Integer; ColumnValues: Variant; var Width: Extended); begin if ColumnIndex=0 then Width:=0; end;

How can you print empty cells to the end of the page if MasterData1 contains 3-5 rows of data?

Add anotherMasterData2 to the report with empty cells and manage the MasterData2.RowCount value in the script in the data footer engine

How can I repeat the printing of MasterData the required number of times? The number is specified in one of the record fields.

Add the DetailData band to the report. Set DetailData.RowCount=1 (This is required!) In the MasterData1OnBeforePrint event, set DetailData.RowCount:= On the DetailData band, place a memo with fields from the dataset linked to MasterData. Set the MasterData height to 0: MasterData.Height=0

How can I get access to RTF text? (something like string s:=Rich.RichText.Lines.RTF)

In the code above, when you click on TfrxRichView, its contents are copied to Memo1 in the dialog form: procedure Rich1OnPreviewClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean); var st: TMemorystream; begin st:=TMemoryStream.Create; Rich1.RichEdit.StreamFormat := 0; Rich1.RichEdit.Lines.SaveToStream(st); st.Position := 0; Memo1.Lines.LoadFromStream(st); st.Free; DialogPage1.ShowModal; end;

In the report script, the values of Page1.PaperHeight, Page1.TopMargin, etc., are represented in mm, while the values of the height of objects are represented in pixels. How to convert mm to pixels?

Use the constants fr01cm (to convert mm to pixels), fr1cm (to convert cm to pixels) in the script

In the report script, I need to set the file name for the export filter, but the export filter classes are missing from the script. How can I add them?

In Delphi: frxReport1.Script.AddClass(TfrxCustomExportFilter, 'TComponent'); frxReport1.Script.AddClass(TfrxCustomImageExport, 'TfrxCustomExportFilter'); frxReport1.Script.AddClass(TfrxBMPExport, 'TfrxCustomImageExport'); frxReport1.Script.AddClass(TfrxRTFExport, 'TfrxCustomExportFilter'); ... frxReport1.Script.AddObject('frxRTFExport1',frxRTFExport1); frxReport1.Script.AddObject('frxBMPExport1',frxBMPExport1); ... In the script: Code frxRTFExport1.FileName := 'myFilename.rtf';

How do I add the SendToBack function to my script?

Use the code constructor TFunctions.Create(AScript: TfsScript); begin inherited Create(AScript); with AScript do begin with TfsClassVariable(Find('TfrxView')) do AddMethod('procedure SendToBack',CallMethod); end; end; initialization fsRTTIModules.Add(TFunctions);

Is it possible to change the font style in TfrxMemoView depending on the state of the group header (collapsed/expanded)?

To do this, you need to register a custom function in the report script that will return the state of the group header function TForm1.frxReport1UserFunction(const MethodName: String; var Params: Variant): Variant; begin if MethodName = 'CHECKDRILLSTATE' then Result := frxReport1.DrillState.IndexOf(Params[0]); end; procedure TForm1.FormShow(Sender: TObject); begin frxReport1.AddFunction('function CheckDrillState(DrillName : string): integer'); end; and in the report script itself, check the state of the group header and set the required font style procedure GroupHeader1OnBeforePrint(Sender: TfrxComponent); begin if CheckDrillState(GroupHeader1.DrillName) <> - 1 then Memo6.Font.Style := fsBold else Memo6.Font.Style := 0; end;

Building a list of functions:

Use the code ``` unit Unit1;

interface

uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, frxClass, fsitools, fsxml, frxRes, frxrcDesgn, frxDesgn, ComCtrls;

type TForm1 = class(TForm) frxReport1: TfrxReport; TreeView1: TTreeView; procedure FormShow(Sender: TObject); private { Private declarations } public { Public declarations } end;

var Form1: TForm1;

implementation {$R *.dfm}

procedure TForm1.FormShow(Sender: TObject); var XML: TfsXMLDocument; procedure SetImageIndex(Node: TTreeNode; Index: Integer); begin Node.ImageIndex := Index; Node.StateIndex := Index; Node.SelectedIndex := Index; end; procedure AddFunctions(xi: TfsXMLItem; Root: TTreeNode); var i: Integer; Node: TTreeNode; s: String; begin s := xi.Prop['text']; if xi.Count = 0 then s := Copy(s, Pos(' ', s) + 1, 255) else { function } s := frxResources.Get(s); { category } if CompareText(s, 'hidden') = 0 then Exit; Node := TreeView1.Items.AddChild(Root, s); if xi.Count = 0 then Node.Data := xi; if Root = nil then Node.Text := frxResources.Get('dtFunc'); if xi.Count = 0 then SetImageIndex(Node, 52) else SetImageIndex(Node, 66); for i := 0 to xi.Count - 1 do AddFunctions(xi[i], Node); end; begin XML := TfsXMLDocument.Create; TreeView1.Images := frxResources.MainButtonImages; frxReport1.Script.AddRTTI; GenerateXMLContents(frxReport1.Script, XML.Root); TreeView1.Items.BeginUpdate; TreeView1.Items.Clear; AddFunctions(XML.Root.FindItem('Functions'), nil); TreeView1.FullExpand; TreeView1.TopItem := TreeView1.Items[0]; TreeView1.Items.EndUpdate; end; end. ```

Depending on certain conditions, I want to hide/show specific pages of the report in the script, but the code Page1.Visible := False does not hide Page1.

You can set the visibility of the report page before it starts rendering, for example, in the main report procedure. Your code will not work in Page1.OnBeforePrint.

How to create a report where a dialog box appears at the beginning of its execution

Create a report where a dialog box appears at the beginning. In the dialog, choose one of two options: continue executing the current report or call a new report from it. When calling a new report, you need to close the preview form of the first report. Otherwise, you will get the following behavior: after calling the second report from the first one, it will execute, show the data, and when closing the preview window of the second report, you will see an empty preview window of the first report. Next, use a custom function in Delphi: procedure TForm1.FormCreate(Sender: TObject); begin frxReport1.AddFunction('function CloseReport'); frxReport1.LoadFromFile('testReport1.fr3'); frxReport1.ShowReport(); end; function TForm1.frxReport1UserFunction(const MethodName: String; var Params: Variant): Variant; begin if MethodName='CLOSEREPORT' then frxReport1.PreviewForm.Close; end; //in the script: procedure Button1OnClick(Sender: TfrxComponent); var rep: TfrxReport; begin rep := TfrxReport.Create(Report); rep.EngineOptions := Report.EngineOptions; rep.LoadFromFile('TestReport2.fr3'); rep.ShowReport; CloseReport; end;

In the FastReport2 version, when creating a MasterBand, it is possible to select Virtual DataSet. FR4 does not have such item

Set the band's RowCount property

Does FastReport work with Delphi XE7 to build a 64-bit application?

Yes

How can I print the page number on the back of each sheet of the report?

Only by adding a page with a page number. You can generate a report, add the same number of pages with numbers, and then re-sort them var i, j: integer; page : TfrxReportPage; begin j := frxReport1.PreviewPages.Count div 2; page := TfrxReportPage.Create(nil); for i := 0 to j - 2 do begin page.AssignAll(frxReport1.PreviewPages.Page[j + i]); frxReport1.PreviewPages.AddEmptyPage(i * 2 + 1); frxReport1.PreviewPages.ModifyPage(i * 2 + 1, page); frxReport1.PreviewPages.DeletePage(j + i + 1); end; page.Free; frxReport1.ShowPreparedReport; end;

Which driver is used to connect ODBC for SQL Server?

ADO, but you can use others as well

Is it true that using TfrxBDEComponents is impossible and instead you always need to use TfrxDBDataset and TDataSet?

Yes, you either need to make internal datasets yourself or look for implementations

I have several custom non-convertible QR components (e.g., TMyQRLabel, which only modify default properties). Is there a way to convert them?

Yes, you can add a condition with TQRLabel in your class name in the converter module.

Is there a way to pass code in events when using QR code, for example, before printing for the band?

The script does not convert

If the QR report inherits from another QR report, the conversion fails. Is there a way around this?

Support for inherited forms is not yet available.

How do I load and unload from the database? When reading, an "invalid format" error appears.

Set Stream.Position := 0;

I need to pass a Unicode string to the report. How can I do that?

Pass the string in UTF8 encoding. For example, the character "diameter" can be passed with the following code: frxReport1.Script.Variables['test']:= UTF8Decode('⌀');

Is FastScript compatible with multithreading?

Compatible, but there are features, described on page 54 Another way to use TfsScript without fsGlobalUnit (for example, in multi-threaded environment) https://www.fastreport.ru/public_download/fs_en.pdf

When building a report with a cross table, there is an error «Could convert variant of type (String) into type (Double)».

If string values are used in a cross table cell, then you need to disable the aggregate function in the "Cross Tables" editor.

How to override the button handler in the standard preview window?

The following handler overrides the Open button handler ``` uses frxClass, frxPreview, frxPreviewPages, frxRes; type TForm1 = class(TForm) frxReport1: TfrxReport; procedure frxReport1Preview(Sender: TObject); procedure NewOnClick(Sender: TObject); end;

var Form1: TForm1;

implementation {$R *.dfm}

procedure TForm1.frxReport1Preview(Sender: TObject); begin if frxReport1.PreviewForm is TfrxPreviewForm then begin TfrxPreviewForm(frxReport1.PreviewForm).OpenB.OnClick := NewOnClick; TfrxPreviewForm(frxReport1.PreviewForm).RightMenu.Items[3].OnClick := NewOnClick; end; end;

procedure TForm1.NewOnClick(Sender: TObject); var OpenDlg: TOpenDialog; begin if frxReport1.Engine.Running then Exit; OpenDlg := TOpenDialog.Create(nil); try OpenDlg.Options := [ofHideReadOnly]; OpenDlg.Filter := frxResources.Get('clFP3files') + ' (.fp3)|.fp3'; if OpenDlg.Execute then begin TfrxPreview(frxReport1.Preview).LoadFromFile(OpenDlg.FileName); frxReport1.PreviewForm.Caption := OpenDlg.FileName; end; finally OpenDlg.Free; end; end; end. ```

Fast Reports
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314

© 1998-2024 Fast Reports Inc.
Trustpilot