Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default Value for Parameter Field

Status
Not open for further replies.

21128

Programmer
Aug 27, 2009
36
US
I am using Crystal Reports XI, Oracle 10g and Esoms as the application to view Crystal Reports. I used the below xml file to pass parameter fields. It works perfect but when the parameter box pops up to select date, it is blank. I can click Ok to proceed without the data entered and it gets the values that i have passed through XML. But the problem is, the values that the crystal reports gets is not seen as a default value in parameter field when i run the report. Is there someway that the parameter field is filled with default value?

Thanks


<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs=" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Menu">
<xs:complexType>
<xs:sequence>

<!-- pName is the name of the parameter in Crystal Reports -->
<xs:element name="pName" type="xs:string" minOccurs="0" />

<!-- sql is the sql statement needed to populate a drop down list with values.
If there is one column of data, it will be displayed and passed in as the
parameter value when selected. If there are two columns of data, the first
column will be the hidden drop down list value. The second column will be
displayed. When a value is selected, the hidden value will be passed into
Crystal Reports. -->
<xs:element name="sql" type="xs:string" minOccurs="0" />
<!-- RequiredField can be "Yes" or "No". If yes then user will be required to
input a value otherwise user can skip this input. Note: The next field,
"ValueIfNoInput" will be sent to Crystal Report if user does not input
a value and CR must be designed to handle this situation. -->
<xs:element name="RequiredField" type="xs:string" minOccurs="0" />

<!-- ValueIfNoInput is the value which will be input to Crystal Reports for
this parameter if the user does not supply an input. -->
<xs:element name="ValueIfNoInput" type="xs:string" minOccurs="0" />

<!-- Words to prompt user to input or select something -->
<xs:element name="Prompt" type="xs:string" minOccurs="0" />

<!-- Data type to be input to report. Values can be string, date, boolean, integer
or number. This field is only used by "ADO" reports. All others get data type
from the Crystal Report parameter declaration -->
<xs:element name="DataType" type="xs:string" minOccurs="0" />

<!-- Yes or No input value used only by ADO reports. If Yes, then the check box
to allow "not equal" to the associated input is shown. Requires logic to be
coded in the web application software. -->
<xs:element name="ShowNotEqual" type="xs:string" minOccurs="0" />

</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<Menu>
<pName>StartDate</pName>
<sql></sql>
<RequiredField>No</RequiredField>
<ValueIfNoInput></ValueIfNoInput>
<Prompt>Enter Starting Date</Prompt>
<DataType>date</DataType>
<ShowNotEqual>No</ShowNotEqual>
</Menu>
</NewDataSet>
 
In wxsl, xs:element can be assigned a default value like this.
[tt] <xs:element name="pName" type="xs:string" minOccurs="0" [blue]default="StartDate"[/blue] />[/tt]
Whether that be effective in this specific application environment, I cannot tell.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top