FastReport开发人员指南中文版

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

-1-FastReport2.4-2-FastReport1---------------------------------------------------------------------------FastReportPDFAdobeAcrobatReader5!FastreportFastreport----------------------------------------------------------------------------3----------------------------------------------------------------------------:bitbird@126.com----------------------------------------------------------------------------4----------------------------------------------------------------------------FastReportDelphiIsABCdingxilinzhanzehuaredfoxGZCYPxiao_q654321hegyi-3-FastReport--------------------------------------------------------:?:TfrReport.OnUserFunctionprocedureTForm1.frReport1UserFunction(constName:String;p1,p2,p3:Variant;varval:Variant);beginifAnsiCompareText('SUMTOSTR',Name)=0thenval:=My_Convertion_Routine(frParser.Calc(p1));end;SumToStr:Ok,TfrReport.TfrReport:OnUserFunction:typeTMyFunctionLibrary=class(TfrFunctionLibrary)publicconstructorCreate;override;procedureDoFunction(FNo:Integer;p1,p2,p3:Variant;varval:Variant);override;end;constructorTMyFunctionLibrary.Create;begininheritedCreate;withListdobeginAdd('DATETOSTR');Add('SUMTOSTR');end;end;procedureTMyFunctionLibrary.DoFunction(FNo:Integer;p1,p2,p3:Variant;varval:Variant);beginval:=0;caseFNoof0:val:=My_DateConvertion_Routine(frParser.Calc(p1));1:val:=My_SumConvertion_Routine(frParser.Calc(p1));end;-4-end;frRegisterFunctionLibrary(TMyFunctionLibrary);frUnRegisterFunctionLibrary(TMyFunctionLibrary);::frAddFunctionDesc(FR_Class):frAddFunctionDesc(FuncLib,'SUMTOSTR','Myfunctions','SUMTOSTR(Number)/Convertsnumbertoitsverbalpresentation.');:/.FuncLibnil-----------------------------------------------------TfrReport.Dictionary.VariableswithfrReport1.Dictionarydobegin//creatingcategory(spaceincategorynamerequired!)Variables['Newcategory']:='';//creatingvariablesVariables['NewVariable']:='CustomerData.Customers.CustNo';Variables['AnotherVariable']:='Page#';end;withfrReport1.DictionarydoVariables['Month']:='March';:FastReportwithfrReport1.DictionarydoVariables['Month']:=''''+'March'+'''';frVariables::TfrReport.Dictionary.DisabledDatasets:-5-withfrReport1.Dictionarydobegin//turnofthisdatasetDisabledDatasets.Add('CustomerData.Bio');//or,turnoffentiredatamodule/formDisabledDatasets.Add('CustomerData*');end;::frVariablesFR_ClassfrVariables['Myvariable']:=10;Myvariable10TfrReport.OnGetValueprocedureTForm1.frReport1GetValue(ParName:String;varParValue:Variant);beginifParName='MyField'thenParValue:=Table1MyField.Value;end;withfrReport1.DictionarydobeginVariables['MyVariable']:='CustomerData.Customers.CustNo';Variables['AnotherVariable']:='10';end;::frVariablesMyVariable:=10MyVariablev:=frVariables['MyVariable'];----------------(FastReportPascal)----------------------------------6-:band:bandCtrl+EnterOnBeforePrint::OnBeforePrintOnActivate:Memo1Memo2.Memo1memo2:ObjectName.PropertyName.::Font.Name,Font.Size------------------------------------------------------------::tab.::TfrReport.MixVariablesAndDBFields:=True.::TfrTextExportShowDialogFasle:TotalPages0.:-:BLOB:frReport1.FileName:='Nameofmyreport';::TfrDesigner.OnLoadReportOnSaveReport.procedureTForm1.frDesigner1LoadReport(Report:TfrReport;-7-varReportName:String;varOpened:Boolean);beginwithMyOpenDialogdobeginOpened:=ShowModal=mrOk;ifOpenedthenbeginReport.LoadFromBlobField(...);ReportName:=...;end;end;end;procedureTForm1.frDesigner1SaveReport(Report:TfrReport;varReportName:String;SaveAs:Boolean;varSaved:Boolean);beginifSaveAsthenwithMySaveDialogdobeginSaved:=ShowModal=mrOk;ifSavedthenbeginReport.SaveToBlobField(...);ReportName:=...;end;endelseReport.SaveToBlobField(...);end;:QRQRLabel1.Caption:='Sometext'.FR?:FRQR,RB.TfrReport.FindObjectvart:TfrMemoView;begint:=TfrMemoView(frReport1.FindObject('Memo1'));iftnilthent.Memo.Text:='FastReport';end;::OnKeyDown::-8-frReport1.PrepareReport;frReport1.PrintPreparedReport('',1,True,frAll);orfrReport1.PrintPreparedReportDlg;::TfrReportOnBeforePrint:ifView.Name='Picture1'thenTfrPictureView(View).Picture.LoadFromFile(...)or.Assignor.everything_what_you_want-9-..........................................................................................................................................................................................................12......................................................................................................................................................................................................13FASTREPORT...........................................................................................................................................................................14FASTREPORT............................................................................................................................................................

1 / 137
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功