原創(chuàng)|其它|編輯:郝浩|2012-09-04 14:56:44.000|閱讀 755 次
概述:講述了在使用XtraReport過程中對于Bookmark的使用心得,詳細(xì)講述了Bookmark屬性設(shè)置的方法,并附上代碼示例。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
轉(zhuǎn)自博客園//www.cnblogs.com/byeah/archive/2010/06/13/1757292.html
文檔結(jié)構(gòu)圖(Document map)以一個樹狀形式集合了是整個報表的書簽Bookmark。XtraReport下載 在報表打印預(yù)覽默認(rèn)情況下它是其停靠左側(cè)的,也可以輸出為PDF,如下面的圖所示:
報表中的書簽必須由報表控件指定。可以通過以下兩個屬性設(shè)置:
XRControl.Bookmark 該屬性值只要是非空字符串就可以在文檔視圖中創(chuàng)建一個書簽。此外可以通過綁定數(shù)據(jù)設(shè)定書簽,使多個書簽出現(xiàn)在文檔視圖。
如:
xrTableCell5.DataBindings.Add("Bookmark", DataSource, "Name", "Name-{0}");
xrTableCell5.DataBindings.Add(new XRBinding("Bookmark", DataSource, "Name", "Name-{0}"));
XRControl.BookmarkParent 該屬性用于創(chuàng)建層次結(jié)構(gòu)的書簽。指定該屬性到某個報表控件后,當(dāng)前控件的書簽將會從屬于BookmarkParent的書簽。否則,當(dāng)前書簽會從屬于文檔的根書簽下。
報表中有任意一個控件設(shè)置了 bookmark屬性,預(yù)覽窗體上面就會出現(xiàn)Document map按鈕。默認(rèn)情況下也會出現(xiàn)文檔結(jié)構(gòu)圖面板。用戶可以通過Document map按鈕設(shè)置面板隱藏或顯示。運行時也可以通過代碼控制該面板的顯示狀態(tài)。
代碼
using DevExpress.XtraPrinting;
// ...
// Create a report and generate its document.
XtraReport1 report = new XtraReport1();
report.CreateDocument();
// Hide a document map.
report.PrintingSystem.PreviewForm.PrintControl.ExecCommand(PrintingSystemCommand.DocumentMap, new object[] {false});
// Show a document map.
report.PrintingSystem.PreviewForm.PrintControl.ExecCommand(PrintingSystemCommand.DocumentMap, new object[] {true});
隱藏/顯示Document map按鈕
代碼
// Hide the Document Map button.
report.PrintingSystem.SetCommandVisibility(PrintingSystemCommand.DocumentMap, CommandVisibility.None);
// Show the Document Map button.
report.PrintingSystem.SetCommandVisibility(PrintingSystemCommand.DocumentMap, CommandVisibility.All);
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:網(wǎng)絡(luò)轉(zhuǎn)載