【问题标题】:How to remove or hide Component Tray from End-User ? XtraReports Winforms Devexpress?如何从最终用户移除或隐藏组件托盘? XtraReports Winforms Devexpress?
【发布时间】:2023-04-01 04:18:02
【问题描述】:

我想向最终用户隐藏或删除此组件托盘。如何完成这个任务。

【问题讨论】:

    标签: winforms devexpress report


    【解决方案1】:

    我同意@DmitryG

    来自How to: Hide the Component Tray from End-Users in the Report Designer的代码 应该工作

    using System;
    using System.Windows.Forms;
    using DevExpress.XtraReports.Design;
    using DevExpress.XtraReports.UserDesigner;
    // ...
    
    private void button1_Click(object sender, EventArgs e) {
        // Create an End-User Designer form.
        XRDesignForm designForm = new XRDesignForm();
    
        // Handle the DesignPanelLoaded event.
        designForm.DesignMdiController.DesignPanelLoaded +=
            new DesignerLoadedEventHandler(DesignMdiController_DesignPanelLoaded);
    
        // Load a report into the Designer.
        designForm.OpenReport(new XtraReport1());
    
        // Show the End-User Designer form, modally.
        designForm.ShowDialog();
    }
    
    // List the components in the Report Explorer, instead of the Component Tray.
    void DesignMdiController_DesignPanelLoaded(object sender, DesignerLoadedEventArgs e) {
        ((XRDesignPanel)sender).ComponentVisibility = ComponentVisibility.ComponentTray;
    }
    

    【讨论】:

    • 嗨,最后一行的 ComponentVisibility 出现错误。
    • 您使用的是哪个 devexpress 版本?
    • DevExpress 12.2 版
    • 文档支持最新版本的 Devexpress。尝试将您的解决方案升级到最新版本 13.2
    【解决方案2】:

    您是否尝试过阅读documentation 或联系DevExpress Support?

    Create an End-User Reporting Application - 本文档列出了在各种平台上创建和自定义最终用户报告应用程序的示例。

    示例: How to: Hide the Component Tray from End-Users in the Report Designer

    【讨论】:

    • 嗨,我已经阅读并使用了该代码,但在最后一行的 ComponentVisibility 上出现错误,这就是这里提出问题的原因
    • 错误显示为“不包含ComponentVisibility 并且没有扩展方法ComponentVisibility 接受第一个参数......”
    • 您是否引用了所有 required 程序集(例如,用于 ConponentVisibility 的 DevExpress.XtraReports.vxx.x.Extensions.dll)?
    • 无论如何,当您在 DevExpress 产品中发现问题或在使用时遇到问题时,您应该联系官方 DevExpress 支持,而不是在这里发布所有这些多个问题。这是获得有保证的官方快速帮助的唯一途径。
    • 是的,我引用了所有需要的程序集。 DevExpress.XtraReports.v12.2.dll 和 DevExpress.XtraReports.v12.2.Extensions.dll
    猜你喜欢
    • 2014-03-10
    • 2014-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-07
    • 2014-11-02
    • 1970-01-01
    相关资源
    最近更新 更多