<?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 : SetVirtualMode</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : SetVirtualMode]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 21 Apr 2026 20:46:40 +0000</pubDate>
  <lastBuildDate>Mon, 03 Jul 2006 03:48:54 +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=4513</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[SetVirtualMode : Ok, the answer firstly. This piece...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13970&amp;title=setvirtualmode#13970</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=862">sserge</a><br /><strong>Subject:</strong> 4513<br /><strong>Posted:</strong> 03 July 2006 at 3:48am<br /><br />Ok, the answer firstly. This piece of code could be used to change row count:<br><table width="99%"><tr><td><pre class="BBcode"><br>wndReport.SetVirtualMode(new CVirtualRecord(), 6);<br>wndReport.Populate();<br></pre></td></tr></table><br><br>Then let me describe some details for you. <br><br>1. In regular (non-virtual) mode Report Control stores data (Records and Record Items) in its internal collection.<br>&nbsp;<br>2. In virtual mode report control does not store data (except the only&nbsp; single record to know data structure). But it also stores records count and requests only portion of data which is necessary to display.<br> <br>This is useful if you already have a data storage (a collection of objects or even a DataBase). In this mode data is not duplicated in your storage and Report's storage and you do not need to synchronize both data collections. <br> <br>As I understand you read data in another thread and want to add records to report control in run-time; also you do not have a big amount of records. So far I think that you do not need to use a virtual mode there.<br><br>Just simply add new records to the control's collection and call Populate() after every bunch (50-100, 200) of records was added.<br><br>--<br>WBR,<br>Serge<br><br> ]]>
   </description>
   <pubDate>Mon, 03 Jul 2006 03:48:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13970&amp;title=setvirtualmode#13970</guid>
  </item> 
  <item>
   <title><![CDATA[SetVirtualMode : Another issue which your demo...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13951&amp;title=setvirtualmode#13951</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2135">freediver211</a><br /><strong>Subject:</strong> 4513<br /><strong>Posted:</strong> 30 June 2006 at 11:45am<br /><br />Another issue which your demo or documentation does not address is not knowing the record size until run time. <DIV>&nbsp;</DIV><DIV>If we are adding rows at runtime how then can you dynamically change the row count for a single Virtual Record?</DIV><DIV>&nbsp;</DIV><DIV>Let's say we create a Singleton to the VirtualRecord and we modify the row count, well that doesn't work so I fail to see how virtual mode will work with dynamic data at runtime.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>For example, </DIV><DIV>&nbsp;</DIV><DIV>OnInitDialog() I have let's say 5 records.&nbsp; Then once the app is loaded I get a sixth record.&nbsp; How do I dynamically change the row count from 5 to 6?</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 30 Jun 2006 11:45:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13951&amp;title=setvirtualmode#13951</guid>
  </item> 
  <item>
   <title><![CDATA[SetVirtualMode : Serge,   I don&amp;#039;t think...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13945&amp;title=setvirtualmode#13945</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2135">freediver211</a><br /><strong>Subject:</strong> 4513<br /><strong>Posted:</strong> 30 June 2006 at 9:18am<br /><br />Serge, <DIV>&nbsp;</DIV><DIV>I don't think you are understanding my question.&nbsp; Let me try to explain again with an example.</DIV><DIV>&nbsp;</DIV><DIV>Let's take an example of a database that is being populated at runtime by another process.&nbsp; Let's say you have <strong>x</strong> number of new records you want to read from the database and populate via the report control.&nbsp; If we take your example, we would have to make <strong>x</strong> number of read seeks to the database for each call back.&nbsp; Rather, the prefered method would be to get one read from the DB with all the records.&nbsp; Then for each call back populate the appropriate row.</DIV><DIV>&nbsp;</DIV><DIV>One way to do this is to assign a local variable to the VirtualRecord class which will contain the data (ie. an CList or something).&nbsp;&nbsp; Then for each call back access the appropriate record.&nbsp; This doesn't seem the optimal solution.&nbsp; </DIV><DIV>&nbsp;</DIV><DIV>void GetDataMethod()</DIV><DIV>{</DIV><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><DIV>Begin Loop...</DIV><DIV>&nbsp;</DIV><DIV>pVirtualRecord-&gt;SetList(somedata);</DIV><DIV>&nbsp;</DIV><DIV>End Loop...</DIV></BLOCKQUOTE><DIV>}</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>void GetItemMetrics (XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XTP_REPORTRECORDITEM_METRICS* pItemMetrics)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int nIndex = pDrawArgs-&gt;pRow-&gt;GetIndex();<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CString myData = GetListItem(nIndex);</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>pItemMetrics-&gt;strText</strong>.Format(_T("%s"), myData...);<BR><BR>&nbsp;&nbsp;&nbsp; }</DIV><DIV><BR>&nbsp;</DIV><DIV>So, can you please explain to me if there is an alternative solution to getting access to the correct data at run time?&nbsp;&nbsp; </DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 30 Jun 2006 09:18:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13945&amp;title=setvirtualmode#13945</guid>
  </item> 
  <item>
   <title><![CDATA[SetVirtualMode : As you can see from the sample,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13933&amp;title=setvirtualmode#13933</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=862">sserge</a><br /><strong>Subject:</strong> 4513<br /><strong>Posted:</strong> 29 June 2006 at 5:56pm<br /><br />As you can see from the sample, the key class is CVirtualRecord and key method is GetItemMetrics, which is called before displaying each record item. In your code you can set it's properties including caption, as folllows:<br>pItemMetrics-&gt;strText = "your text". In the sample below it is formatted depneding on the current column and row numbers:<br><table width="99%"><tr><td><pre class="BBcode"><br>class CVirtualRecord : public CXTPReportRecord<br>{<br>public:<br>&nbsp;&nbsp;&nbsp; CVirtualRecord()<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; AddItem(new CXTPReportRecordItem());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; AddItem(new CXTPReportRecordItem());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; AddItem(new CXTPReportRecordItem());<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; void GetItemMetrics (XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPReportColumnOrder* pSortOrder = pDrawArgs-&gt;pControl-&gt;GetColumns()-&gt;GetSortOrder();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; BOOL bDecreasing = pSortOrder-&gt;GetCount() &gt; 0 &amp;&amp; pSortOrder-&gt;GetAt(0)-&gt;IsSortedDecreasing();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CString strColumn = pDrawArgs-&gt;pColumn-&gt;GetCaption();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int nIndex = pDrawArgs-&gt;pRow-&gt;GetIndex();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int nCount = pDrawArgs-&gt;pControl-&gt;GetRows()-&gt;GetCount();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <b>pItemMetrics-&gt;strText</b>.Format(_T("%s - Row %i"), strColumn, bDecreasing? nCount - nIndex: nIndex + 1);<br><br>&nbsp;&nbsp;&nbsp; }<br>};<br></pre></td></tr></table><br><br><br>--<br>WBR,<br>Serge<br>]]>
   </description>
   <pubDate>Thu, 29 Jun 2006 17:56:31 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13933&amp;title=setvirtualmode#13933</guid>
  </item> 
  <item>
   <title><![CDATA[SetVirtualMode : Ok, so how do you pass your data...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13916&amp;title=setvirtualmode#13916</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2135">freediver211</a><br /><strong>Subject:</strong> 4513<br /><strong>Posted:</strong> 29 June 2006 at 1:01pm<br /><br />Ok, so how do you pass your data into the&nbsp;callback to populate the list? <DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 29 Jun 2006 13:01:16 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13916&amp;title=setvirtualmode#13916</guid>
  </item> 
  <item>
   <title><![CDATA[SetVirtualMode : Hi,Please look at our VirtualList...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13912&amp;title=setvirtualmode#13912</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=862">sserge</a><br /><strong>Subject:</strong> 4513<br /><strong>Posted:</strong> 29 June 2006 at 10:47am<br /><br />Hi,<br><br>Please look at our VirtualList sample firstly.<br><br>Note that in virtual mode there are no a collection of records, but only 1 "virtual" record. All actual data is set on callback with GetItemMetrics method.<br><br>--<br>WBR,<br>Serge<br>]]>
   </description>
   <pubDate>Thu, 29 Jun 2006 10:47:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13912&amp;title=setvirtualmode#13912</guid>
  </item> 
  <item>
   <title><![CDATA[SetVirtualMode : I am trying to add a lot of records...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13911&amp;title=setvirtualmode#13911</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2135">freediver211</a><br /><strong>Subject:</strong> 4513<br /><strong>Posted:</strong> 29 June 2006 at 9:14am<br /><br />I am trying to add a lot of records to a <FONT size=2>CXTPReportControl at runtime.&nbsp;&nbsp;I am using SetVirtualMode to add those records.&nbsp; However,&nbsp;only the last record is display&nbsp;multiple times.&nbsp; What am&nbsp;I doing wrong?<DIV>&nbsp;</DIV><DIV>Inside my method I call:</DIV><DIV>&nbsp;</DIV><DIV>Begin Loop...</DIV><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><DIV>rowCount++;<BR>m_wndReportCtrl.SetVirtualMode(new CVirtualMessageRecord&nbsp; (alarmType, </DIV><DIV>&nbsp;deviceId, </DIV><DIV>&nbsp;deviceName, </DIV><DIV>&nbsp;latitude, </DIV><DIV>&nbsp;longitude, </DIV><DIV>&nbsp;altitude, </DIV><DIV>&nbsp;newEvent), rowCount );&nbsp; </DIV></BLOCKQUOTE><DIV>End Loop...</DIV><FONT size=2><P>m_wndReportCtrl.Populate();</P><DIV></DIV><P>Any thoughts?</P><DIV></DIV>Thanks!</FONT></FONT>]]>
   </description>
   <pubDate>Thu, 29 Jun 2006 09:14:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4513&amp;PID=13911&amp;title=setvirtualmode#13911</guid>
  </item> 
 </channel>
</rss>