<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Problem Loading Records from XML</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : Problem Loading Records from XML]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 19 Apr 2026 03:36:25 +0000</pubDate>
  <lastBuildDate>Wed, 17 Feb 2010 15:11:48 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=16178</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Problem Loading Records from XML : Solved.The problem was I was saving...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16178&amp;PID=56868&amp;title=problem-loading-records-from-xml#56868</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2657">Algae</a><br /><strong>Subject:</strong> 16178<br /><strong>Posted:</strong> 17 February 2010 at 3:11pm<br /><br />Solved.<br><br>The problem was I was saving columns based on position not by index! Doh. Changed "GetAt" to Find and it works perfectly.<br><br>&nbsp;&nbsp;&nbsp; CXTPPropExchangeSection secColumns(pPX-&gt;GetSection(_T("ColumnNames")));<br>&nbsp;&nbsp;&nbsp; DWORD nColumnCount = GetReportCtrl().GetColumns()-&gt;GetCount();<br>&nbsp;&nbsp;&nbsp; CXTPPropExchangeEnumeratorPtr pEnumColumns(secColumns-&gt;GetEnumerator(_T("Column")));<br>&nbsp;&nbsp;&nbsp; POSITION posColumn = pEnumColumns-&gt;GetPosition(nColumnCount);<br>&nbsp;&nbsp;&nbsp; for (DWORD i = 0; i &lt; nColumnCount; i++)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPPropExchangeSection secColumn(pEnumColumns-&gt;GetNext(posColumn));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPReportColumn* pColumn = GetReportCtrl().GetColumns()-&gt;Find(i); // was getat &lt;&lt;&lt; <img src="http://forum.codejock.com/smileys/smiley15.gif" border="0" align="absmiddle"><br>]]>
   </description>
   <pubDate>Wed, 17 Feb 2010 15:11:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16178&amp;PID=56868&amp;title=problem-loading-records-from-xml#56868</guid>
  </item> 
  <item>
   <title><![CDATA[Problem Loading Records from XML : Problem: When loading Records...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16178&amp;PID=56749&amp;title=problem-loading-records-from-xml#56749</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2657">Algae</a><br /><strong>Subject:</strong> 16178<br /><strong>Posted:</strong> 11 February 2010 at 5:36pm<br /><br />Problem: When loading Records from an XML file, RecordItems end up in wrong columns. Any suggestions on how to correct this?<br><br>For example:<br><br>Initial report looks like:<br><br>col 1 | col 2 | col 3<br>---------------------<br>a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; b&nbsp;&nbsp;&nbsp; |&nbsp; c<br><br>Save the report, load it, everything is fine.<br><br>Now rearrange the columns, by dragging and dropping. So far so good record items are in the correct columns.<br><br>col 1 | col 3 | col 2<br>---------------------<br>a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b<br><br>Save this new configuration. Load it again. As illustrated, the columns are fine, but the record items no longer correspond with the proper column!<br><br>col 1 | col 3 | col 2<br>---------------------<br>a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c<br><br>The basic mechanism used is shown here with the exception of my column load/save function.<br><br>saving:<br><br>CXTPPropExchangeXMLNode px(FALSE, 0, _T("ReportControl"));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>// save columns<br><br>// save records<br>CXTPPropExchangeSection secRecords(px.GetSection(_T("Records")));<br>GetReportCtrl().GetRecords()-&gt;DoPropExchange(&amp;secRecords);<br><br>// save column configuration<br>GetReportCtrl().DoPropExchange(&amp;px);<br><br>px.SaveToFile(sReportName);<br><br>loading:<br><br>CXTPPropExchangeXMLNode px(TRUE, 0, _T("ReportControl"));<br><br>if (!px.LoadFromFile(sReportPath))<br>&nbsp;&nbsp;&nbsp;&nbsp; return FALSE;<br><br>px.ExchangeLocale();<br><br>GetReportCtrl().ResetContent();<br>GetReportCtrl().GetColumns()-&gt;Clear();<br><br>// load columns<br><br>// load records<br>CXTPPropExchangeSection secRecords(px.GetSection(_T("Records")));<br>GetReportCtrl().GetRecords()-&gt;DoPropExchange(&amp;secRecords);<br><br>// set column properties<br>GetReportCtrl().DoPropExchange(&amp;px);<br><br><br>VS2008<br>CJ 13.2.2<br><br>]]>
   </description>
   <pubDate>Thu, 11 Feb 2010 17:36:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16178&amp;PID=56749&amp;title=problem-loading-records-from-xml#56749</guid>
  </item> 
 </channel>
</rss>