Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Data Connectivity
Message Icon Topic: XML and Web Services - Data relationships Post Reply Post New Topic
Author Message
dnewton
Newbie
Newbie


Joined: 06 Jun 2013
Location: United States
Online Status: Offline
Posts: 2
Quote dnewton Replybullet Topic: XML and Web Services - Data relationships
    Posted: 11 Jul 2013 at 5:12am

I am using the CR 2011 developer tool to try and consume XML data using the HTTP XML URL option under XML and Web Services.  At least this is my ultimate goal.  I have hit a bit of a road block in that Crystal seems unable to correctly represent sibling elements belonging to a common parent.  I have constructed a simplified example of what my XML looks like. A salesperson is assigned to two different regions and to two different accounts.  The regions and accounts exist as sibling elements belonging to the parent salesperson.  When I insert the sales_person_name, region_name and account_name into the details section of the report I expect to see four rows.  The four rows would represent each combination of region and account for this single salesperson.  Instead I only get three rows.   I see this behavior when using either HTTP XML URL or Local XML File options under XML and Web Services.  Each option requires I supply a schema which I have also supplied below.  I do not see the same behavior when viewing the same data using the ADO.NET XML data connection option.  Unfortunately this option is not sufficient as it simply offers the ability to consume a static XML file.  I must have the ability to generate a Web Service request via URL and apply arguments to the request. 

 

I am wondering if I am doing something wrong or perhaps this type of XML structure is not supported by these data connection options?  I would welcome any suggestions on how I can make this work.  It is not  practical for me to change the XML structure for all the different Web Services that might be used as a report data source however. 

 

I am also curious as to whether others have attempted to use Crystal reports and the HTTP XML URL option under XML and Web Services as a data connection. 

 

 

<?xml version="1.0" encoding="UTF-8"?>

<sales>

    <salesperson>

        <sales_person_id>1</sales_person_id>

        <sales_person_name>Joe Smith</sales_person_name>

        <region>

            <region_id>3</region_id>

            <region_name>Northwest US</region_name>

            <country>US</country>

        </region>

        <region>

            <region_id>19</region_id>

            <region_name>Southeast England</region_name>

            <country>UK</country>

        </region>

        <account>       

            <acct_id>100</acct_id>

            <account_name>ACME Corp</account_name>

            <account_level>Level 1</account_level>

        </account>

        <account>       

            <acct_id>200</acct_id>

            <account_name>Generic Co.</account_name>

            <account_level>Level 2</account_level>

        </account>

    </salesperson>

</sales>

 

The schema

 

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="sales">

    <xs:complexType>

      <xs:sequence>

        <xs:element name="salesperson" maxOccurs="unbounded" minOccurs="0">

          <xs:complexType>

            <xs:sequence>

              <xs:element type="xs:int" name="sales_person_id"/>

              <xs:element type="xs:string" name="sales_person_name"/>

              <xs:element name="region" maxOccurs="unbounded" minOccurs="0">

                <xs:complexType>

                  <xs:sequence>

                    <xs:element type="xs:int" name="region_id"/>

                    <xs:element type="xs:string" name="region_name"/>

                    <xs:element type="xs:string" name="country"/>

                  </xs:sequence>

                </xs:complexType>

              </xs:element>

              <xs:element name="account" maxOccurs="unbounded" minOccurs="0">

                <xs:complexType>

                  <xs:sequence>

                    <xs:element type="xs:int" name="acct_id"/>

                    <xs:element type="xs:string" name="account_name"/>

                    <xs:element type="xs:string" name="account_level"/>

                  </xs:sequence>

                </xs:complexType>

              </xs:element>

            </xs:sequence>

          </xs:complexType>

        </xs:element>

      </xs:sequence>

    </xs:complexType>

  </xs:element>

</xs:schema>

dnewton
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 19 Jul 2013 at 5:28am
ADO is not for a static file...since I have used that type of connection for years. Rather, I would set the Datasource of the report to an XML file with same schema that the report was designed against.

I will agree, that if you put a file out on a server, ADO will not 'read' it until you 'verify the database'...

I realize that this was posted a while ago, and a solution may already have been reached. I just thought that I would give my experience with ADO connections.

HTH
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.