原創|行業資訊|編輯:楊鵬連|2021-06-11 14:37:14.207|閱讀 179 次
概述:FastReport用戶可以在報告中指定一個或多個變量。本文詳細介紹了什么是“樣式”、“樣式集”和“樣式庫”。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
FastReport VCL是用于Delphi,C ++ Builder,RAD Studio和Lazarus的報告和文檔創建VCL庫。它提供了可視化模板設計器,可以訪問為30多種格式,并可以部署到云,網站,電子郵件和打印中。
近日,FastReport VCL更新至v6.9,在新版本中,在PDF更新中增加了對以下對象的并行表單支持:文本,替換和圖片。相互之間形式中。同時修復了多個Bug問題。歡迎下載體驗。(旁邊向下按鈕下載)
首先,讓我們記住什么是“樣式”、“樣式集”和“樣式庫”。
樣式是一個元素,它擁有名稱和屬性,并決定了設計屬性,即顏色、字體和框架。樣式決定了報表對象的設計方式。諸如此類的對象TfrxMemoView具有Style屬性,該屬性旨在設置樣式名稱。將值應用于此屬性時,樣式設計屬性將復制到對象。
一組樣式由多個樣式組成,它們引用一個報表。該TfrxReport組分具有Styles屬性,該屬性是指的對象TfrxStyles類型。這組樣式也有一個名字。樣式集決定了整個報表的設計。
樣式庫包括多組樣式。在庫的幫助下,可以方便地為報表設計選擇一個具體的集合。
該TfrxStyleItem代表風格。
TfrxStyleItem = class(TCollectionItem)
public
// Style name.
property Name: String;
// Background color.
property Color: TColor;
// Font.
property Font: TFont;
// Frame.
property Frame: TfrxFrame;
end;
樣式集由TfrxStyles類表示。它包括執行讀取、保存、添加、刪除以及搜索樣式等設置操作的方法。默認情況下,樣式文件集具有 FS3 擴展名。
TfrxStyles = class(TCollection)
public
// Creates the styles set. One can specify “nil” instead of “AReport,” however in this case a user would be unable to use the “Apply” method.
constructor Create(AReport: TfrxReport);
// Adds a new style.
function Add: TfrxStyleItem;
// Returns the style with the given name.
function Find(const Name: String): TfrxStyleItem;
// Applies a set to a report.
procedure Apply;
// Returns the list of the styles names.
procedure GetList(List: TStrings);
// Reads a set.
procedure LoadFromFile(const FileName: String);
procedure LoadFromStream(Stream: TStream);
// Saves a set.
procedure SaveToFile(const FileName: String);
procedure SaveToStream(Stream: TStream);
// The list of styles.
property Items[Index: Integer]: TfrxStyleItem; default;
// A set’s name.
property Name: String;
end;
總之,最后一個TfrxStyleSheet類代表一個樣式庫。它具有庫讀取/保存以及添加、刪除和樣式集搜索的方法。
TfrxStyleSheet = class(TObject)
public
// Constructs a library.
constructor Create;
// Clears a library.
procedure Clear;
// Deletes a set with certain number.
procedure Delete(Index: Integer);
// Returns the list of the names of styles’ sets.
procedure GetList(List: TStrings);
// Loads a library.
procedure LoadFromFile(const FileName: String);
procedure LoadFromStream(Stream: TStream);
// Saves a library.
procedure SaveToFile(const FileName: String);
procedure SaveToStream(Stream: TStream);
// Adds a new set of styles to the library.
function Add: TfrxStyles;
// Returns a number of styles’ sets in the library.
function Count: Integer;
// Returns a set with the given name.
function Find(const Name: String): TfrxStyles;
// Returns a set number with the given name.
function IndexOf(const Name: String): Integer;
// The list of styles’ sets.
property Items[Index: Integer]: TfrxStyles; default;
end;
如果您對FastReport感興趣,歡迎加入FastReport QQ交流群:702295239
還想要更多嗎?您可以點擊閱讀【FastReport報表2021最新資源盤點】,查找需要的教程資源。讓人興奮的是FastReport .NET正在慧都網火熱銷售中!>>查看價格詳情
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自: