zoukankan      html  css  js  c++  java
  • How to: Access the Report Parameters Object in Report Scripts 如何:访问报表脚本中的报表参数对象

    This topic describes how you can access data of the report parameters object (inherited from ReportParametersObjectBase and specified using IReportDataV2.ParametersObjectType) in report scripts.

    本主题介绍如何访问报表参数对象的数据(从报表参数对象基础继承并使用 IReportDataV2.参数对象类型)在报表脚本中指定。

    Note 注意
    The approach described in this topic is not supported by the Mobile platform.
    移动平台不支持本主题中描述的方法。

     

    Use the following code to access the Parameters Object from a script.

    使用以下代码从脚本访问参数对象。

    object xafParameters = 
        ((DevExpress.XtraReports.UI.XtraReport)sender).Parameters["XafReportParametersObject"].Value

    For instance, the following script displays the name of the Position selected in the parameters dialog as a label text.

    例如,以下脚本将参数对话框中选择的位置的名称显示为标签文本。

    private void ContactsBaseReport_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
        label1.Text ="";
        DevExpress.XtraReports.Parameters.Parameter param = 
            (DevExpress.XtraReports.Parameters.Parameter)((DevExpress.XtraReports.UI.XtraReport)sender).
                Parameters["XafReportParametersObject"];
        if(param != null) {
            MySolution.DemoParameters xafParameter = 
                (MySolution.DemoParameters)param.Value;
            label1.Text = xafParameter.ContactPosition.Name;
        }
    }
  • 相关阅读:
    如何管理和优化日益增长的代码复杂度?
    groupcache-readme-go
    shell脚本的桩
    软件的模块化开发
    ldd命令--查看命令依赖的库文件
    链接
    LDD命令--可执行文件依赖的库出现错误时
    开源日志系统 log4c 使用心得+总结
    SDOI2018R1划水记
    BZOJ1009:[HNOI2008]GT考试(AC自动机,矩乘DP)
  • 原文地址:https://www.cnblogs.com/foreachlife/p/How-to-Access-the-Report-Parameters-Object-in-Report-Scripts.html
Copyright © 2011-2022 走看看