<?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 : Report C&#111;ntrols Selected Rows in c#</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Suite Pro : Report C&#111;ntrols Selected Rows in c#]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 27 May 2026 12:34:40 +0000</pubDate>
  <lastBuildDate>Fri, 28 Jan 2005 06:39:20 +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=1712</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[Report C&#111;ntrols Selected Rows in c# : Thanks for the reply, i realised...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1712&amp;PID=4875&amp;title=report-controls-selected-rows-in-c#4875</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=913">amorton</a><br /><strong>Subject:</strong> 1712<br /><strong>Posted:</strong> 28 January 2005 at 6:39am<br /><br />Thanks for the reply, i realised that was a option but i wanted to tryand avoid it if possible. After all there is a COM enumeratoravailable, so i worked out how to get to it. It goes something likethis...<br><br>The definition of the IReportSelectedRows interface (from ole view) isa dispactch interface and there is no definition of the _NewEnumproperty. However this prop is allways implemented with a dispatch IDof -4 so vb will just call Invoke on the IDispatch interface with -4 toget the enumerator for a for each loop.<br><br>The com enumerator returned implements IEnumVARIANT com interface, idid not check for any other interfaces. Which is not that different tothe IEnumerable interface in dot net. <br><br>When an active x dll is imported dot net&nbsp; uses AxImp.exe to makethe active X host sub class, it is an object of this class thatrepresents the control on the page. This utility can export the sourceit creates for the ax host sub class.<br><br>So i used AxHost to make a c# class that hosts the report control. Ithen added a function to the report control in dot net calledSelectedRowsEnumerator that returns a object that can be used forfor-each in c#.<br><br>This function :<br>1 - casts the base ocx controls selectedRows property/object to a dot net definition of the&nbsp; COM IDispatch interface.<br><br>2 - Calls invoke on the dispatch interface to invoke the get propertywith disp ID -4, this is the _NewEnum property. It is possible to callthings by name a little easier in dot net i think, but i was not surehow and not sure if the ocx class would implement a call by nameconsidering it was not declared in the interface. <br><br>3 - casts the result of the invoke to a dot net definition of the IEnumVARIANT interface.<br><br>4 - returns a class that implements both IEnumerable and IEnumeratorand wraps access to the com based enumerator returned in step 4 above.The IEnumerable implementation just returns itself so the object can beused in a for each statement. <br><br>So now i can write code like this in c#<br><br>foreach (XtremeReportControl.ReportRow&nbsp; row in report.SelectedRowsEnumerator())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br><br>I also added a property to get the first item in the collection to make things easier when there is one item selected.<br><br>hope that helps.<br><br>aaron<br><br>]]>
   </description>
   <pubDate>Fri, 28 Jan 2005 06:39:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1712&amp;PID=4875&amp;title=report-controls-selected-rows-in-c#4875</guid>
  </item> 
  <item>
   <title><![CDATA[Report C&#111;ntrols Selected Rows in c# : Try the following. It will return...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1712&amp;PID=4865&amp;title=report-controls-selected-rows-in-c#4865</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=260">Boyd</a><br /><strong>Subject:</strong> 1712<br /><strong>Posted:</strong> 27 January 2005 at 2:31pm<br /><br /><P>Try the following.&nbsp; It will return an array of all the selected rows (with the option to exclude any grouped rows).&nbsp; This function assumes that your report control is accessible to the method through the 'reportControl' variable.</P><P>public XtremeReportControl.ReportRow&#091;&#093; GetSelectedRows(bool includeGroupRows)<BR>{<BR>&nbsp;&nbsp;&nbsp; ArrayList rowsList = new ArrayList();<BR>&nbsp;&nbsp;&nbsp; for (int j = 0; j &lt; reportControl.Rows.Count; j++)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (reportControl.Rows&#091;j&#093;.Selected)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; if (includeGroupRow || reportControl.Rows&#091;j&#093;.GroupRow == false)<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rowsList.Add(reportControl.Rows&#091;j&#093;);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; XtremeReportControl.ReportRow&#091;&#093; rows = new XtremeReportControl.ReportRow&#091;rowsList.Count&#093;;<BR>&nbsp;&nbsp;&nbsp; rowsList.CopyTo(rows);<BR>&nbsp;&nbsp;&nbsp; return rows;<BR>}</P><P>I apologize if there are syntax errors... I wrote this from scratch.</P><span style="font-size:10px"><br /><br />Edited by Boyd</span>]]>
   </description>
   <pubDate>Thu, 27 Jan 2005 14:31:34 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1712&amp;PID=4865&amp;title=report-controls-selected-rows-in-c#4865</guid>
  </item> 
  <item>
   <title><![CDATA[Report C&#111;ntrols Selected Rows in c# : Hello there, i had been using...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1712&amp;PID=4861&amp;title=report-controls-selected-rows-in-c#4861</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=913">amorton</a><br /><strong>Subject:</strong> 1712<br /><strong>Posted:</strong> 27 January 2005 at 9:48am<br /><br />Hello there, i had been using the report control in VB and decided in see how well it would go in dot net. <br><br>In VB6 i had issues with accessing the selected rows for the report, ineeded to do a for each to get the selected row even when there wasonly one row selected as there is no Item property on the selectedRowscollection.<br><br>When i use the control in dot net things get worse. The tlb importercannot detect whatever process is used to provide enumeration in vb andso does not provide a way to get a IEnumerator for the collection. Sothere is no way to peform a foreach.<br><br>As there is no item accessor for the collection i cannot see how toaccess any of the rows int he selected rows collection.&nbsp; If anyoneknows how to do this could they let me know please.<br><br>thanks<br>aaron<br><br>]]>
   </description>
   <pubDate>Thu, 27 Jan 2005 09:48:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1712&amp;PID=4861&amp;title=report-controls-selected-rows-in-c#4861</guid>
  </item> 
 </channel>
</rss>