翻譯|使用教程|編輯:楊鵬連|2021-07-22 09:52:01.710|閱讀 243 次
概述:高性能報(bào)表控件FastReport如何自定義數(shù)據(jù)庫引擎編寫,注冊(cè)組件。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
FastReport VCL是用于 Delphi、C++ Builder、RAD Studio 和 Lazarus 的報(bào)告和文檔創(chuàng)建 VCL 庫。它提供了可視化模板設(shè)計(jì)器,可以訪問 30 多種格式,并可以部署到云、網(wǎng)站、電子郵件和打印中。
立即點(diǎn)擊下載FastReport VCL v6.9最新版
所有組件注冊(cè)都在“初始化”部分執(zhí)行。
initialization
{ use standard pictures indexes 37,38,39 instead of pictures}
frxObjects.RegisterObject1(TfrxIBXDataBase, nil, '', '', 0, 37);
frxObjects.RegisterObject1(TfrxIBXTable, nil, '', '', 0, 38);
frxObjects.RegisterObject1(TfrxIBXQuery, nil, '', '', 0, 39);
finalization
frxObjects.Unregister(TfrxIBXDataBase);
frxObjects.Unregister(TfrxIBXTable);
frxObjects.Unregister(TfrxIBXQuery);
end.
這足以在報(bào)告中使用我們的數(shù)據(jù)庫組件。在此階段還剩下兩件事:在腳本系統(tǒng)中注冊(cè) DB 類以使其在腳本中可用,以及注冊(cè)多個(gè)屬性編輯器(例如,TfrxIBXTable.TableName)以更輕松地使用組件。
最好將腳本注冊(cè)碼存放在一個(gè)帶有 RTTI 后綴的單獨(dú)文件中。更多關(guān)于在腳本系統(tǒng)中注冊(cè)類的內(nèi)容請(qǐng)參見相應(yīng)章節(jié)。這是此類文件的示例:
unit frxIBXRTTI;
interface
{$I frx.inc}
implementation
uses
Windows, Classes, fs_iinterpreter, frxIBXComponents
{$IFDEF Delphi6}
, Variants
{$ENDIF};
type
TFunctions = class(TfsRTTIModule)
public
constructor Create(AScript: TfsScript); override;
end;
{ TFunctions }
constructor TFunctions.Create;
begin
inherited Create(AScript);
with AScript do
begin
AddClass(TfrxIBXDatabase, 'TfrxComponent');
AddClass(TfrxIBXTable, 'TfrxCustomDataset');
AddClass(TfrxIBXQuery, 'TfrxCustomQuery');
end;
end;
initialization
fsRTTIModules.Add(TFunctions);
end.
如果您對(duì) FastReport 感興趣,歡迎加入 FastReport QQ 交流群:702295239
還想要更多嗎?您可以點(diǎn)擊閱讀【FastReport報(bào)表2021最新資源盤點(diǎn)】,查找需要的教程資源。上是FastReport .NET慧正在網(wǎng)火熱銷售中!>>查看價(jià)格詳情
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: