Xml with XSD Data source problem

Stimulsoft Reports.NET discussion
Post Reply
Larusso
Posts: 32
Joined: Tue May 20, 2008 9:27 am
Location: Poland

Xml with XSD Data source problem

Post by Larusso »

Hi, I have couple of questions.
I'm trying to use XSD data source.
1) How can I create relations between nodes automatically? Right now this data source consists of seperate "tables"
2) How can I get to nodes children? I have a multiple occurrence node that has two child nodes (occurrence 0..1). I need to show in one row data from parent node and from both child nodes
Here is a part of xsd structure:

<xs:element name="RepeatabilityReading">
<xs:complexType>
<xs:all>
<xs:element ref="TestPoint"/>
<xs:element ref="RepeatabilityAsFound" minOccurs="0"/>
<xs:element ref="RepeatabilityAsLeft" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="RepeatabilityAsFound" type="RepeatabilityReadingPoint"/>
<xs:complexType name="RepeatabilityReadingPoint">
<xs:all>
<xs:element ref="Value"/>
<xs:element ref="PointId"/>
<xs:element ref="NotPerformed"/>
<xs:element ref="ReplacedByPoint"/>
<xs:element ref="Additive" minOccurs="0"/>
<xs:element ref="ValueOfLoad" minOccurs="0"/>
<xs:element ref ="IsEuramet" />
<xs:element ref="OutsideEurametRange" />
<xs:element ref="InitialVerificationResult" minOccurs="0"/>
<xs:element ref="InServiceResult" minOccurs="0"/>
</xs:all>
</xs:complexType>
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Xml with XSD Data source problem

Post by Alex K. »

Hello,

You can add following attributes in the XSD file:

Code: Select all

    <xs:keyref name="CategoriesProducts" refer="Constraint1">
      <xs:selector xpath=".//Products" />
      <xs:field xpath="CategoryID" />
    </xs:keyref>
Pleases check the Demo.xsd in the attachment.

Thank you.
Attachments
Demo.xsd
(12.72 KiB) Downloaded 220 times
Larusso
Posts: 32
Joined: Tue May 20, 2008 9:27 am
Location: Poland

Re: Xml with XSD Data source problem

Post by Larusso »

Hi, Thanks for the reply.
I don't think Your example deals with this case. In You xsd Customers and Orders have explicit key to connect with and they are independent nodes. In my example RepeatabilityAsFound and RepeatabilityAsLeft are children of RepeatabilityReading and there is no explicit key to connect one to another. This xsd can't be modified.

Thanks
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Xml with XSD Data source problem

Post by Alex K. »

Hello,

Please check the following article:
https://www.w3schools.com/xml/schema_complex.asp

Thank you.
Larusso
Posts: 32
Joined: Tue May 20, 2008 9:27 am
Location: Poland

Re: Xml with XSD Data source problem

Post by Larusso »

Hello,
Not helpful at all, read it, know it, not related to my problem and also I already wrote I'm not allowed to change xsd on which report must be based.
Thank You
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Xml with XSD Data source problem

Post by Alex K. »

Hello,

In this case, you can try to manually add relations between data sources in the designer.

Thank you.
Larusso
Posts: 32
Joined: Tue May 20, 2008 9:27 am
Location: Poland

Re: Xml with XSD Data source problem

Post by Larusso »

Thanks, I knew I could add relation to parent, so from child could get to parent, but in this case I had to have relation to child. I already managed to do that by simply creating a reverse relation and it works but has its limitations. For now it is sufficient
Thanks
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Xml with XSD Data source problem

Post by Alex K. »

Hello

Ok
Please let us know if you need any additional help.

Thank you.
Post Reply