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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

condition in xml schema

Status
Not open for further replies.

21128

Programmer
Aug 27, 2009
36
0
0
US
Below is my XML Schema to pass parameter for Crystal Report.
I am wondering if i could give a condition to change Texts inside the <Prompt> </Prompt>. In my case if {?Log_ID}=33 then <Prompt>Include Unit 1 [ Default : Yes ]</Prompt> but if {?Log_ID}=41then <Prompt>Unit Not in this Section</Prompt>

<?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>Log_ID</pName>
<sql>select log_id, log_title from log_list where log_id in (25,29,33,37,41) order by log_sort_order</sql>
<RequiredField>Yes</RequiredField>
<ValueIfNoInput></ValueIfNoInput>
<Prompt>Select Log </Prompt>
<DataType>integer</DataType>
<ShowNotEqual>No</ShowNotEqual>
</Menu>
<Menu>
<pName>Unit1Checked</pName>
<sql>select 'Yes' from dual where {?Log_ID}=33 or {?Log_ID}=29 or {?Log_ID}=25 union select 'No' from dual where {?Log_ID}=33 or {?Log_ID}=29 or {?Log_ID}=25 </sql>
<RequiredField>No</RequiredField>
<ValueIfNoInput>Yes</ValueIfNoInput>
<Prompt>Include Unit 1 [ Default : Yes ]</Prompt>
<DataType>string</DataType>
<ShowNotEqual>No</ShowNotEqual>
</Menu>
<Menu>
<pName>Unit2Checked</pName>
<sql>select 'Yes' from dual union select 'No' from dual</sql>
<RequiredField>No</RequiredField>
<ValueIfNoInput>Yes</ValueIfNoInput>
<Prompt>Include Unit 2 [ Default : Yes ]</Prompt>
<DataType>string</DataType>
<ShowNotEqual>No</ShowNotEqual>
</Menu>
</NewDataSet>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top