Back to Devexpress

Parameter.Visible Property

corelibraries-devexpress-dot-xtrareports-dot-parameters-dot-parameter-d24bae38.md

latest6.8 KB
Original Source

Parameter.Visible Property

Specifies whether a parameter editor is visible in the Parameters panel.

Namespace : DevExpress.XtraReports.Parameters

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
[DefaultValue(true)]
public bool Visible { get; set; }
vb
<DefaultValue(True)>
Public Property Visible As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true to show a parameter editor; otherwise, false.

|

Remarks

All hidden parameters are submitted to a report with default values. You can also submit default values for all report parameters (visible and hidden) when you open a report Preview. For this, disable the report’s RequestParameters property.

Example

The following example hides an editor of the Company parameter.

Visible = true (Default)Visible = false
csharp
using DevExpress.XtraReports.Parameters;
// ...
report.Parameters["company"].Visible = false;
vb
Imports DevExpress.XtraReports.Parameters
' ...
report.Parameters("company").Visible = False

You can also specify an expression for the Visible property to show/hide a parameter editor based on a value of another parameter.

csharp
using DevExpress.XtraReports.Parameters;
// ...
using DevExpress.XtraReports.Expressions;
// ...
report.Parameters["company"].ExpressionBindings.Add(
    new BasicExpressionBinding() {
        PropertyName = "Visible",
        Expression = "!IsNullOrEmpty(?customer)",
    }
);
vb
Imports DevExpress.XtraReports.Parameters
' ...
Imports DevExpress.XtraReports.Expressions
' ...
report.Parameters("company").ExpressionBindings.Add(
    New BasicExpressionBinding() With {
        .PropertyName = "Visible",
        .Expression = "!IsNullOrEmpty(?customer)"
    }
)

The following code snippets (auto-collected from DevExpress Examples) contain references to the Visible property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

reporting-winforms-salary-reports/CS/SalaryReports/MainForm.cs#L24

csharp
report.Parameters["paramEmpName"].Value = string.Empty;
report.Parameters["paramEmpName"].Visible = false;
e.Control = new DocumentViewerUserControl() { Report = report };

reporting-winforms-parameter-multivalue/CS/Program.cs#L45

csharp
// values as defaults.
parameter1.Visible = true;
parameter1.SelectAllValues = true;

angular-reporting-use-custom-ui-elements-to-specify-parameters/CS/ReportingWebApp/Services/CustomReportProvider.cs#L37

csharp
foreach (var parameter in report.Parameters) {
    parameter.Visible = false;
}

Reporting-Blazor-JSBased-Viewer-Specify-Parameters/CS/BlazorApp/Services/CustomReportProvider.cs#L38

csharp
foreach (var parameter in report.Parameters) {
    parameter.Visible = false;
}

reporting-winforms-add-report-parameters/CS/ReportParameterExample/Form1.cs#L23

csharp
param1.Description = "Category: ";
param1.Visible = true;

reporting-winforms-salary-reports/VB/SalaryReports/MainForm.vb#L20

vb
report.Parameters("paramEmpName").Value = String.Empty
report.Parameters("paramEmpName").Visible = False
e.Control = New DocumentViewerUserControl() With {.Report = report}

reporting-winforms-parameter-multivalue/VB/Program.vb#L49

vb
' values as defaults.
parameter1.Visible = True
parameter1.SelectAllValues = True

reporting-winforms-add-report-parameters/VB/ReportParameterExample/Form1.vb#L24

vb
param1.Description = "Category: "
param1.Visible = True
' Add the parameter to the report.

See Also

Use Report Parameters

Parameter Class

Parameter Members

DevExpress.XtraReports.Parameters Namespace