翻譯|使用教程|編輯:王香|2018-12-10 10:12:10.000|閱讀 338 次
概述:此示例顯示如何使用Business Objects集合創(chuàng)建報(bào)表。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
下載Stimulsoft Reports Silverlight最新版本
此示例顯示如何使用Business Objects集合創(chuàng)建報(bào)表。Business Objects是一個(gè)對象類數(shù)據(jù),使用它可以以不同的結(jié)構(gòu)呈現(xiàn)數(shù)據(jù):表,列表,數(shù)組等。要使用Bisiness對象,您可以使用報(bào)表對象的RegBusinessObject()方法:
private void btDesign_Click(object sender, RoutedEventArgs e) { var stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream( "UsingBusinessObjects.SimpleList.mrt"); StiReport report = new StiReport(); report.Load(stream); stream.Close(); stream.Dispose(); stream = null; report.CalculationMode = StiCalculationMode.Interpretation; report.RegBusinessObject("Data", "Data", new Data()); report.Design(); } private void btPreview_Click(object sender, RoutedEventArgs e) { var stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream( "UsingBusinessObjects.SimpleList.mrt"); StiReport report = new StiReport(); report.Load(stream); stream.Close(); stream.Dispose(); stream = null; report.CalculationMode = StiCalculationMode.Interpretation; report.RegBusinessObject("Data", "Data", new Data()); report.Render(); report.Show(); }
Data()對象包含報(bào)表所需的數(shù)據(jù)結(jié)構(gòu)和數(shù)據(jù)行:
public class Data { private List<CategoriesItem> categoriesItems = new List<CategoriesItem>(); public List<CategoriesItem> Categories { get { return categoriesItems; } set { categoriesItems = value; } } public class CategoriesItem { private List<ProductsItem> products; public List<ProductsItem> Products { get { return products; } set { products = value; } } private System.Int32? categoryID; public System.Int32? CategoryID { get { return categoryID; } set { categoryID = value; } } ...
下面的屏幕截圖中,您可以看到示例代碼的結(jié)果。
購買Stimulsoft正版授權(quán),請點(diǎn)擊“”喲!
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn