翻譯|使用教程|編輯:王香|2018-09-10 13:52:31.000|閱讀 383 次
概述:本文主要講解Stimulsoft的Detalization實時報表。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
【下載Stimulsoft Reports.Ultimate最新版本】
此示例項目顯示如何在單獨的預覽窗口中進行報表分離。該報告可能包含外部報表中的詳細數據。例如,主要和詳細報表顯示在單獨的預覽窗口中。加載主報表,為click事件添加事件偵聽器,并在查看器中顯示此報表:
private void button2_Click(object sender, System.EventArgs e) { StiReport report = new StiReport(); report.RegData(dataSet1); report.Load("..\\LiveReports.mrt"); report.Compile(); report.CompiledReport.Click += new EventHandler(click); report.Show(); }
在click事件中,您可以使用主報表中的參數加載包含數據過濾的詳細報表:
private void click(object sender, EventArgs e) { StiComponent comp = sender as StiComponent; string customerID = (string)comp.BookmarkValue; if (customerID != null) { StiReport report = new StiReport(); report.RegData(dataSet1); report.Load("..\\Details.mrt"); StiDataBand dataBand = (StiDataBand)report.Pages["Page1"].Components["DataBand1"]; StiFilter filter = new StiFilter("{Orders.CustomerID==\"" + customerID + "\"}"); dataBand.Filters.Add(filter); report.Show(); } }
示例代碼的結果如下圖所示:
購買Stimulsoft正版授權,請點擊“”喲!
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn