共用方式為


DefaultValue Element (RDL)

Specifies the default value to use for the parameter.

語法

<ReportParameter> Name="...">
    ...
    <DefaultValue>
        <DataSetReference> Name="..."> <!-- or <Values> --> 
            ...
        </DataSetReference> <!-- or /Values -->
    </DefaultValue>
    ...
</ReportParameter>

Element Characteristics

Characteristic Description

Data type and length

None

Default value

None

Cardinality

0-1: Optional element that can occur once or not at all. For more information, see "Remarks."

Element Relationships

Relationship Element

Parent element

ReportParameter

Child elements

DataSetReference, Values

備註

The DefaultValue element must have one and only one child element: DataSetReference or Values.

The value of DefaultValue is used for the parameter if the user does not provide a parameter value. If no value is provided for DefaultValue either, the value for the parameter is Null.

When using the DataSetReference element, the default is the first value in the field specified by the ValueField element.

One and only one default value is allowed for Boolean parameters.

If one of the default values is not valid, the entire set of default values is treated as not valid.

If the sibling Prompt element is omitted*,* DefaultValue is required if the value for the sibling Nullable element is False or the values within the sibling ValidValues element do not contain Null.

請參閱

參考

Report Definition XML Elements
Nullable Element (RDL)

說明及資訊

取得 SQL Server 2005 協助