zoukankan      html  css  js  c++  java
  • XtraReport学习笔记之Bookmark (一)

    文档结构图(Document map)以一个树状形式集合了是整个报表的书签Bookmark。在报表打印预览默认情况下它是其停靠左侧的,也可以输出为PDF,如下面的图所示

    报表中的书签必须由报表控件指定。可以通过以下两个属性设置:
    XRControl.Bookmark  该属性值只要是非空字符串就可以在文档视图中创建一个书签。此外可以通过绑定数据设定书签,使多个书签出现在文档视图。
    如:

    xrTableCell5.DataBindings.Add("Bookmark", DataSource, "Name", "Name-{0}"); 

    xrTableCell5.DataBindings.Add(new XRBinding("Bookmark", DataSource, "Name", "Name-{0}"));

    XRControl.BookmarkParent 该属性用于创建层次结构的书签。指定该属性到某个报表控件后,当前控件的书签将会从属于BookmarkParent的书签。否则,当前书签会从属于文档的根书签下。 

    报表中有任意一个控件设置了 bookmark属性,预览窗体上面就会出现Document map按钮。默认情况下也会出现文档结构图面板。用户可以通过Document map按钮设置面板隐藏或显示。运行时也可以通过代码控制该面板的显示状态。

    代码
    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);


  • 相关阅读:
    [USACO 2012 Feb B]Moo
    [Atcoder ARC124] XOR Matching 2-小思维 | 暴力
    loj数列分块入门
    2019牛客暑期多校2-Partition problem深搜
    Codeforces 1554C
    [USACO 2012 Feb G]Cow Coupons----贪心&带悔(看完稳AC)
    Codeforces 220B-Little Elephant and Array-扫描线 & 树状数组
    [AtCoder ARC098] Donation| 建图 | 树型dp
    关于幂等性以及怎么实现幂等性
    【OOM】解决思路
  • 原文地址:https://www.cnblogs.com/Byeah/p/1757292.html
Copyright © 2011-2022 走看看