Yes, for customers with an active subscription
Yes, you can find at: Technical Support Statement
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
Yes, on a contractual basis.
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.
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.
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.
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
With the release of FastReport VCL 2023.2, only IDEs from Delphi 2010 to the most recent versions are supported.
Before running the report, you need to set:
TfrxReport.EngineOptions.EnableThreadSafe := True;
TfrxReport.EngineOptions.SilentMode := True;
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);
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;
Make the language file a mkall.bat utility (located in the language directory) and include the language dynamically:
uses frxRes;
frxResources.LoadFromFile('english.xml');
Use this code:
var a: variant;
begin
a := VarArrayOf([1,2,3]);
frxReport1.Script.Variables['a'] := a;
end;
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.
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.
The Fast Report script does not support multiples. You need to do this:
Memo1.Frame.Typ := ftLeft + ftRight + ftTop + ftBottom;
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.
To insert your report name in the title, run:
frxReport1.ReportOptions.Name := 'My report';
In the designer, go to the View|Settings menu and click the Restore Settings button
procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
begin
if MasterData1.DataSet.RecNo = MasterData1.DataSet.RecordCount-1 then Engine.NewPage;
end;
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');
Set the TfrxRichView.Wysiwyg
property to False.
Before generating the report, add:
frxReport1.EngineOptions.DestroyForms:=False;
Use this code:
Rich1.RichEdit.Lines.LoadFromFile()
Use this code:
frxReport1.Engine.StopReport;
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.
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.
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; ```
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;
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; ```
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, go to the View|Settings menu and uncheck the Use object font option
Enable the "Show band titles" option in the designer in the View-Settings menu
Wizard created the report using styles. You need to either change the appropriate style or clear the style of the object
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; ```
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; ```
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;
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;
Try setting
ADODataBase.Connected=False
before changing the connection settings, and then reconnect
Try just setting the width=0
procedure Cross1OnCalcWidth(ColumnIndex: Integer; ColumnValues: Variant; var Width: Extended);
begin
if ColumnIndex=0 then
Width:=0;
end;
Add anotherMasterData2
to the report with empty cells and manage the MasterData2.RowCount
value in the script in the data footer engine
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
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;
Use the constants fr01cm
(to convert mm to pixels), fr1cm
(to convert cm to pixels) in the script
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';
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);
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;
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. ```
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
.
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;
Set the band's RowCount
property
Yes
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;
ADO, but you can use others as well
Yes, you either need to make internal datasets yourself or look for implementations
Yes, you can add a condition with TQRLabel
in your class name in the converter module.
The script does not convert
Support for inherited forms is not yet available.
Set Stream.Position := 0;
Pass the string in UTF8 encoding. For example, the character "diameter" can be passed with the following code:
frxReport1.Script.Variables['test']:= UTF8Decode('⌀');
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
If string values are used in a cross table cell, then you need to disable the aggregate function in the "Cross Tables" editor.
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. ```