翻譯|使用教程|編輯:楊鵬連|2021-06-15 09:27:13.023|閱讀 361 次
概述:以下代碼演示了創(chuàng)建樣式集以及將兩種樣式添加到集的過程。完成這些操作后,樣式將應(yīng)用于報(bào)表。
# 界面/圖表報(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最新版
以下代碼演示了創(chuàng)建樣式集以及將兩種樣式添加到集的過程。完成這些操作后,樣式將應(yīng)用于報(bào)表。
Pascal:
var
Style: TfrxStyleItem;
Styles: TfrxStyles;
Styles := TfrxStyles.Create(nil);
{ the first style }
Style := Styles.Add;
Style.Name := 'Style1';
Style.Font.Name := 'Courier New';
{ the second style }
Style := Styles.Add;
Style.Name := 'Style2';
Style.Font.Name := 'Times New Roman';
Style.Frame.Typ := [ftLeft, ftRight];
{ apply a set to the report }
frxReport1.Styles := Styles;
C++:
TfrxStyleItem * Style;
TfrxStyles * Styles;
Styles = new TfrxStyles(NULL);
// the first style
Style = Styles->Add();
Style->Name = "Style1";
Style->Font->Name = "Courier New";
// the second style
Style = Styles->Add();
Style->Name = "Style2";
Style->Font->Name = "Times New Roman";
Style->Frame->Typ << ftLeft << ftRight;
// apply a set to the report
frxReport1->Styles = Styles;
您可以以不同的方式創(chuàng)建和使用集合:
Pascal:
var
Style: TfrxStyleItem;
Styles: TfrxStyles;
Styles := frxReport1.Styles;
Styles.Clear;
{ the first style }
Style := Styles.Add;
Style.Name := 'Style1';
Style.Font.Name := 'Courier New';
{ the second style }
Style := Styles.Add;
Style.Name := 'Style2';
Style.Font.Name := 'Times New Roman';
Style.Frame.Typ := [ftLeft, ftRight];
{ apply a set to the report }
frxReport1.Styles.Apply;
C++:
TfrxStyleItem * Style;
TfrxStyles * Styles;
Styles = frxReport1->Styles;
Styles->Clear();
// the first style
Style = Styles->Add();
Style->Name = "Style1";
Style->Font->Name = "Courier New";
// the second style
Style = Styles->Add();
Style->Name = "Style2";
Style->Font->Name = "Times New Roman";
Style->Frame->Typ << ftLeft << ftRight;
// apply a set to the report
frxReport1->Styles->Apply();
如果您對(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)載自: