<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: C# set xml data source in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/c-set-xml-data-source/qaa-p/12642543#M4742804</link>
    <description>&lt;P&gt;What are you doing to set the datasource when you run the report?  Are you running this within an application or directly from Crystal?&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;</description>
    <pubDate>Wed, 31 Aug 2022 16:49:15 GMT</pubDate>
    <dc:creator>DellSC</dc:creator>
    <dc:date>2022-08-31T16:49:15Z</dc:date>
    <item>
      <title>C# set xml data source</title>
      <link>https://community.sap.com/t5/technology-q-a/c-set-xml-data-source/qaq-p/12642542</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I use XSD file to design a report and want to read another xml(share the same schema ) to set report's data source. However, the exported pdf has no data. &lt;/P&gt;
  &lt;P&gt;FYI, I use cryastal report 2020 and here are my xsd file code&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" standalone="yes"?&amp;gt;
&amp;lt;xs:schema id="data" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"&amp;gt;
  &amp;lt;xs:element name="data" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"&amp;gt;
    &amp;lt;xs:complexType&amp;gt;
      &amp;lt;xs:choice minOccurs="0" maxOccurs="unbounded"&amp;gt;
        &amp;lt;xs:element name="docid"&amp;gt;
          &amp;lt;xs:complexType&amp;gt;
            &amp;lt;xs:sequence&amp;gt;
              &amp;lt;xs:element name="RptDate" type="xs:string" minOccurs="0" msdata:Ordinal="0" /&amp;gt;
              &amp;lt;xs:element name="PolNo" type="xs:string" minOccurs="0" msdata:Ordinal="1" /&amp;gt;
              &amp;lt;xs:element name="PolicyName" type="xs:string" minOccurs="0" msdata:Ordinal="2" /&amp;gt;
              &amp;lt;xs:element name="NextAnni" type="xs:string" minOccurs="0" msdata:Ordinal="3" /&amp;gt;
              &amp;lt;xs:element name="Address1" type="xs:string" minOccurs="0" msdata:Ordinal="4" /&amp;gt;
              &amp;lt;xs:element name="Address2" type="xs:string" minOccurs="0" msdata:Ordinal="5" /&amp;gt;
              &amp;lt;xs:element name="Address3" type="xs:string" minOccurs="0" msdata:Ordinal="6" /&amp;gt;
              &amp;lt;xs:element name="Address4" type="xs:string" minOccurs="0" msdata:Ordinal="7" /&amp;gt;
              &amp;lt;xs:element name="State" type="xs:string" minOccurs="0" msdata:Ordinal="8" /&amp;gt;
              &amp;lt;xs:element name="CONTPERSON" type="xs:string" minOccurs="0" msdata:Ordinal="9" /&amp;gt;
              &amp;lt;xs:element name="AgentName" type="xs:string" minOccurs="0" msdata:Ordinal="10" /&amp;gt;
              &amp;lt;xs:element name="AGYNAME" type="xs:string" minOccurs="0" msdata:Ordinal="11" /&amp;gt;
              &amp;lt;xs:element name="CommDisclsInd" type="xs:string" minOccurs="0" msdata:Ordinal="12" /&amp;gt;
              &amp;lt;xs:element name="company_code" type="xs:integer" minOccurs="0" msdata:Ordinal="13" /&amp;gt;
              &amp;lt;xs:element name="company_short_name_e" type="xs:string" minOccurs="0" msdata:Ordinal="14" /&amp;gt;
              &amp;lt;xs:element name="company_short_name_c" type="xs:string" minOccurs="0" msdata:Ordinal="15" /&amp;gt;
              &amp;lt;xs:element name="company_full_name_e" type="xs:string" minOccurs="0" msdata:Ordinal="16" /&amp;gt;
              &amp;lt;xs:element name="company_full_name_c" type="xs:string" minOccurs="0" msdata:Ordinal="17" /&amp;gt;
              &amp;lt;xs:element name="fax_number" type="xs:string" minOccurs="0" msdata:Ordinal="18" /&amp;gt;
              &amp;lt;xs:element name="csc_phone" type="xs:string" minOccurs="0" msdata:Ordinal="19" /&amp;gt;
              &amp;lt;xs:element name="print_date" type="xs:string" minOccurs="0" msdata:Ordinal="20" /&amp;gt;
            &amp;lt;/xs:sequence&amp;gt;
            &amp;lt;xs:attribute name="letterdoc"&amp;gt;
			  &amp;lt;xs:simpleType&amp;gt;
				&amp;lt;xs:restriction base="xs:string"&amp;gt;
				  &amp;lt;xs:pattern value="GRNV005R01|GRNV005R02|GRNV005R03|GRNV005R04"/&amp;gt;
				&amp;lt;/xs:restriction&amp;gt;
			  &amp;lt;/xs:simpleType&amp;gt;
			&amp;lt;/xs:attribute&amp;gt;
          &amp;lt;/xs:complexType&amp;gt;
        &amp;lt;/xs:element&amp;gt;
      &amp;lt;/xs:choice&amp;gt;
    &amp;lt;/xs:complexType&amp;gt;
  &amp;lt;/xs:element&amp;gt;
&amp;lt;/xs:schema&amp;gt;&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Aug 2022 15:00:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/c-set-xml-data-source/qaq-p/12642542</guid>
      <dc:creator>huayuz</dc:creator>
      <dc:date>2022-08-31T15:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: C# set xml data source</title>
      <link>https://community.sap.com/t5/technology-q-a/c-set-xml-data-source/qaa-p/12642543#M4742804</link>
      <description>&lt;P&gt;What are you doing to set the datasource when you run the report?  Are you running this within an application or directly from Crystal?&lt;/P&gt;&lt;P&gt;-Dell&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 16:49:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/c-set-xml-data-source/qaa-p/12642543#M4742804</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2022-08-31T16:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: C# set xml data source</title>
      <link>https://community.sap.com/t5/technology-q-a/c-set-xml-data-source/qaa-p/12642544#M4742805</link>
      <description>&lt;P&gt;And are you using ADO.NET (XML) or the native CR XML driver?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 16:09:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/c-set-xml-data-source/qaa-p/12642544#M4742805</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2022-09-12T16:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: C# set xml data source</title>
      <link>https://community.sap.com/t5/technology-q-a/c-set-xml-data-source/qaa-p/12642545#M4742806</link>
      <description>&lt;P&gt;yes, I finally get it out by loading schema file and xml. However, There is another issue. That is,  Images with graphic location will not display in the exported Pdf when I set data source to report, besides, all fields shows correctly in the pdf. Images shows when I did not set data source to the report.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; void SetXmlDataSource(ReportDocument report)
        {
            if(!Utils.CheckFileExists(_configuration.Schema))
            {
                throw new Exception($"File {_configuration.Schema} does not exist");
            }
            if(!Utils.CheckFileExists(_commandLine))
            {
                throw new Exception($"File {_commandLine} does not exist");
            }
            var ds = new DataSet();
            ds.ReadXmlSchema(_configuration.Schema);
            ds.ReadXml(_commandLine);
            report.SetDataSource(ds);
        }&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Report: Crystal Reports 2020&lt;/P&gt;&lt;P&gt;SDK: SAP Crystal Reports, version for Microsoft Visual studio 13.0.32.4286&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 03:33:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/c-set-xml-data-source/qaa-p/12642545#M4742806</guid>
      <dc:creator>huayuz</dc:creator>
      <dc:date>2022-09-15T03:33:54Z</dc:date>
    </item>
  </channel>
</rss>

