fastreport小入门
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids, DBGrids, frxBarcode, DB, ADODB, frxClass, frxDBSet; type TForm1 = class(TForm) ds1: TDataSource; frxReport1: TfrxReport; frxDBDataset1: TfrxDBDataset; qry1: TADOQuery; frxBarCodeObject1: TfrxBarCodeObject; dbgrd1: TDBGrid; btn1: TButton; procedure btn1Click(Sender: TObject); procedure frxReport1ClickObject(Sender: TfrxView; Button: TMouseButton; Shift: TShiftState; var Modified: Boolean); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.btn1Click(Sender: TObject); begin // frxReport1.Clear; // // frxReport1.LoadFromFile('myfr3.fr3'); frxReport1.ShowReport(true); end; procedure TForm1.frxReport1ClickObject(Sender: TfrxView; Button: TMouseButton; Shift: TShiftState; var Modified: Boolean); begin if Sender.Name = 'Memo1' then TfrxMemoView(Sender).Text:= 'lionheart' else if Sender.Name = 'Memo2' then begin ShowMessage(TfrxMemoView(Sender).Text); end else if Sender.Name = 'Memo3' then begin ShowMessage(TfrxMemoView(Sender).Text) end; end; end.
书搞进脑袋 创新 创造; 积极