Print Page | Close Window

XML Data Source and AutoLink

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=5176
Printed Date: 09 May 2024 at 6:15pm


Topic: XML Data Source and AutoLink
Posted By: rwinters
Subject: XML Data Source and AutoLink
Date Posted: 09 Jan 2009 at 11:52am
I'm using the Report Wizart to import an XML file and I'm getting the message "Unable to smart link unlinked tables". Why is this happening?
 
I am also including the schema file which indicates primary and foreign keys.
 
Much thanks ....
Rwinters
 
<SNIP>
 
 
XML File
 
?xml version="1.0" encoding="UTF-8"?>
<Organization xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance - http://www.w3.org/2001/XMLSchema-instance " >
      <dept>
            <Deptno>10</Deptno>
            <Dname>Accounting</Dname>
            <Loc>Dallas</Loc>
      </dept>
      <dept>
            <Deptno>20</Deptno>
            <Dname>Production</Dname>
            <Loc>New York</Loc>
      </dept>
      <Employee>
            <Empno>1001</Empno>
            <Ename>Jag</Ename>
            <Sal>2500</Sal>
            <Deptno>10</Deptno>
      </Employee>
      <Employee>
            <Empno>1002</Empno>
            <Ename>Win</Ename>
            <Sal>2600</Sal>
            <Deptno>20</Deptno>
      </Employee>
</Organization>
--Schema File
 

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

<xs:complexType name="DeptType">

<xs:sequence>

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

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

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

</xs:sequence>

</xs:complexType>

<xs:element name="Organization">

<xs:complexType>

<xs:sequence>

<xs:element maxOccurs="unbounded" name="dept" type="DeptType" />

<xs:element maxOccurs="unbounded" name="Employee" type="EmployeeType" />

</xs:sequence>

</xs:complexType>

<xs:key name="PK_Dept_Deptno">

<xs:selector xpath=".//dept" />

<xs:field xpath="Deptno" />

</xs:key>

<xs:key name="PK_Employee_Empno">

<xs:selector xpath=".//Employee" />

<xs:field xpath="Empno" />

</xs:key>

<xs:keyref name="FK_deptEmployee" refer="PK_Dept_Deptno">

<xs:selector xpath=".//Employee" />

<xs:field xpath="Deptno" />

</xs:keyref>

</xs:element>

<xs:complexType name="EmployeeType">

<xs:sequence>

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

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

<xs:element name="Sal" type="xs:float" />

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

</xs:sequence>

</xs:complexType>

</xs:schema>

 
 
 
 



Replies:
Posted By: hilfy
Date Posted: 20 Jan 2009 at 1:14pm

Rule of thumb - Smart Linking is not very smart.  I ALWAYS turn it off in the Options menu when I do a new installation of Crystal.  From my experience with Crystal over the last 12 years or so, you will get better results if you manually link the tables yourself.

Which version of Crystal are you using?  Have you applied any hot fixes or patches?
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window