The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

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.

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;
    }
}
See Also