PDA

View Full Version : سوال: مشکل در خواندن فایل xml



bita_naz
جمعه 24 مهر 1394, 22:28 عصر
سلام دوستان

من یک فایل xml دارم که وقتی با متد ReadXml دیتاست میخوام بخونمش پیغام زیر رو میده

A column named 'FormattedReportObjects' already belongs to this DataTable: cannot set a nested table name to the same name.

فایل xml رو از اکسپورت کریسال ریپورت بدست می اورم

چطور میتونم فقط داده های فایل رو بخونم و فرمت رو در نظر نگیرم؟

از XmlReadMode.IgnoreSchema هم وقتی استفاده میکنم هیچ داده ای خونده نمیشه

با تشکر:لبخندساده:

aminmousavi
شنبه 25 مهر 1394, 04:29 صبح
سلام دوست عزیز . لطفا فایل xml رو قرار بدید

bita_naz
یک شنبه 26 مهر 1394, 21:21 عصر
این یک نمونه از اون فایل xml هست با یک رکورد (جهت راحت تر شدن بررسی). این فایل از اکسپورت کریستال ریپورت بدست میاد



<?xml version="1.0" encoding="UTF-8" ?>
<FormattedReport xmlns = 'urn:crystal-reports:schemas' xmlns:xsi = 'http://www.w3.org/2000/10/XMLSchema-instance'>
<FormattedAreaPair Level="0" Type="Report">
<FormattedArea Type="Header">
<FormattedSections>
<FormattedSection SectionNumber="0">
<FormattedReportObjects>
</FormattedReportObjects>
</FormattedSection>
</FormattedSections>
</FormattedArea>
<FormattedAreaPair Level="1" Type="Details">
<FormattedArea Type="Details">
<FormattedSections>
<FormattedSection SectionNumber="0">
<FormattedReportObjects>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@UnboundString1}"><ObjectName>UnboundString1</ObjectName>
<FormattedValue>1</FormattedValue>
<Value>1</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@UnboundString2}"><ObjectName>UnboundString2</ObjectName>
<FormattedValue>2</FormattedValue>
<Value>2</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@UnboundString3}"><ObjectName>UnboundString3</ObjectName>
<FormattedValue>04</FormattedValue>
<Value>04</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{@UnboundString11}"><ObjectName>UnboundString4</ObjectName>
<FormattedValue>احمد</FormattedValue>
<Value>احمد</Value>
</FormattedReportObject>
</FormattedReportObjects>
</FormattedSection>
</FormattedSections>
</FormattedArea>
</FormattedAreaPair>
<FormattedArea Type="Footer">
<FormattedSections>
<FormattedSection SectionNumber="0">
<FormattedReportObjects>
</FormattedReportObjects>
</FormattedSection>
</FormattedSections>
</FormattedArea>
</FormattedAreaPair>
</FormattedReport>