近日使用时发现lazreport自带调用fr3的功能,按下面的方法调用就可以:
1、uses 添加fr3tolrf
2、form添加frreport
3、使用LoadFastReport3调用fr3文件
LoadFastReport3(frReport控件名称,fr3格式的文件,返回相应信息);
unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, DB, Forms, Controls, Graphics, Dialogs, StdCtrls, fr3tolrf, LR_Class, LR_Desgn, LR_BarC, LR_DSet, lr_barcodes2d; type { TForm1 } TForm1 = class(TForm) Button1: TButton; Button2: TButton; Edit1: TEdit; frBarCode2d1: TfrBarCode2d; frBarCodeObject1: TfrBarCodeObject; frDesigner1: TfrDesigner; frReport1: TfrReport; frUserDataset1: TfrUserDataset; Memo1: TMemo; OpenDialog1: TOpenDialog; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private public end; var Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject); var Messages:string; begin LoadFastReport3(frReport1,edit1.Text,Messages); frReport1.DesignReport; memo1.Text:=Messages; end; procedure TForm1.Button2Click(Sender: TObject); begin if OpenDialog1.Execute then edit1.Text:=OpenDialog1.FileName; end; end.
标签:lazreport,end,Sender,TForm1,TObject,fr3,格式,procedure From: https://www.cnblogs.com/qiufeng2014/p/18297584