<?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 : Bug in updating report control</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : Bug in updating report control]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 18 Apr 2026 09:08:56 +0000</pubDate>
  <lastBuildDate>Mon, 08 Sep 2008 18:28:32 +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=12105</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[Bug in updating report control : little more clarification: if...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12105&amp;PID=40820&amp;title=bug-in-updating-report-control#40820</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4345">csunita</a><br /><strong>Subject:</strong> 12105<br /><strong>Posted:</strong> 08 September 2008 at 6:28pm<br /><br /><P>little more clarification:</P><P>if i change col1 first, col5 updates as it should. or if chage col5 first, col1 updates as it should.</P><P>but if i first change col1, even multiple times, it works. after that, if i try to change&nbsp;col5, then i am not unable to change/update col5.</P><P>similarly, if i change col5 first, i can do this multiple times, but as soon as i change col 1, i am unable to do so. it keeps on repeating the same value.</P>]]>
   </description>
   <pubDate>Mon, 08 Sep 2008 18:28:32 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12105&amp;PID=40820&amp;title=bug-in-updating-report-control#40820</guid>
  </item> 
  <item>
   <title><![CDATA[Bug in updating report control : uploads/20080908_182308_ReportControl.zip Hello, I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12105&amp;PID=40819&amp;title=bug-in-updating-report-control#40819</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4345">csunita</a><br /><strong>Subject:</strong> 12105<br /><strong>Posted:</strong> 08 September 2008 at 6:24pm<br /><br /><P><a href="https://forum.codejock.com/uploads/20080908_182308_ReportC&#111;ntrol.zip" target="_blank">uploads/20080908_182308_ReportControl.zip</A></P><DIV>Hello,</DIV><P>I have to update&nbsp;report control columns automatically depending on the selection. For example, Column5 = Column1 + Column3 &amp; Column1 = Column5 - Column3 etc</P><DIV>One complication is that some of the columns can be changed dynamically by the user, depending on which column is currenty visible, Column5 could then become sum of col1 + col4 for e.g.</DIV><DIV>I could not do this in the OnEditChanged() of the CXTPReportRecordItem because I was unable to determine how to find out if the record item was visible or not. </DIV><DIV>I manually update everything in the ON_NOTIFY(XTP_NM_REPORT_VALUECHANGED, IDC_BEFORE_CNCTN, OnBeforeCnctnValueChanged) function. Code is attached. </DIV><DIV>Here is the problem. Let's say currenty I have visble col 0, 1, 2, 3, and 5. Col5 is sum of col1 &amp; 3. If I change col1, col5 gets updated correctly. <BR>However, if I now change col5, col1 is supposed to automatically update as difference of col5 and 3. But I am unable to update col5 once I enter values in col1, and col5 updates automatically.</DIV><DIV>&nbsp;</DIV><DIV>Code is copied here: The .h and .cpp files are attached.</DIV><DIV>&nbsp;</DIV><DIV>void CConsumptionDlg::OnBeforeCnctnValueChanged(NMHDR*&nbsp; pNotifyStruct, LRESULT* result)<BR>{<BR>&nbsp;&nbsp;&nbsp; XTP_NM_REPORTRECORDITEM* pItemNotify = (XTP_NM_REPORTRECORDITEM*) pNotifyStruct;<BR>&nbsp;&nbsp;&nbsp; ASSERT(pItemNotify != NULL); </DIV><DIV>&nbsp;&nbsp;&nbsp; int row = pItemNotify-&gt;pRow-&gt;GetIndex();<BR>&nbsp;&nbsp;&nbsp; int col = pItemNotify-&gt;pColumn-&gt;GetIndex();<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; pFinalCurrent-&gt;SetCaption("Final Current &#091;mA&#093;");</DIV><DIV>&nbsp;&nbsp;&nbsp; double dFinalCrnt, dLEDCrnt, dDongleCrnt;<BR>&nbsp;&nbsp;&nbsp; CString strFinalCrnt, strLEDCrnt, strDongleCrnt;</DIV><DIV>&nbsp;&nbsp;&nbsp; if ( pLEDCurrent-&gt;IsVisible() )<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // LED Current cannot be edited, and does not need to be updated<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strLEDCrnt = m_Report_b4_cnctn.GetRecords()-&gt;GetAt(row)-&gt;GetItem(COLUMN_LED_CRNT)-&gt;GetCaption(pLEDCurrent);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dLEDCrnt = atof(strLEDCrnt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Either Dongle Current column changed:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (col == COLUMN_DONGLE_ACTIVE)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strDongleCrnt = pItemNotify-&gt;pItem-&gt;GetCaption(pDongleCurrent);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //strDongleCrnt = pItemNotify-&gt;pItem-&gt;GetItemData();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dDongleCrnt = atof(strDongleCrnt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Update the Final Current:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strFinalCrnt.Format("%.2f", (dDongleCrnt+dLEDCrnt) );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_Report_b4_cnctn.GetRecords()-&gt;GetAt(row)-&gt;GetItem(COLUMN_FINAL_CRNT)-&gt;SetCaption(strFinalCrnt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Or Final Current column changed:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if (col == COLUMN_FINAL_CRNT )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strFinalCrnt = pItemNotify-&gt;pItem-&gt;GetCaption(pFinalCurrent);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //strFinalCrnt = pItemNotify-&gt;pItem-&gt;GetItemData();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dFinalCrnt = atof(strFinalCrnt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Update the Dongle Current:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strDongleCrnt.Format("%.2f", (dFinalCrnt - dLEDCrnt));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_Report_b4_cnctn.GetRecords()-&gt;GetAt(row)-&gt;GetItem(COLUMN_DONGLE_ACTIVE)-&gt;SetCaption(strDongleCrnt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; // Customer LED current has been selected<BR>&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Donlge Current has changed <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (col == COLUMN_DONGLE_ACTIVE)&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strDongleCrnt = pItemNotify-&gt;pItem-&gt;GetCaption(pDongleCurrent);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //strDongleCrnt = pItemNotify-&gt;pItem-&gt;GetItemData();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dDongleCrnt = atof(strDongleCrnt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strLEDCrnt = m_Report_b4_cnctn.GetRecords()-&gt;GetAt(row)-&gt;GetItem(COLUMN_USER_LED_CRNT)-&gt;GetCaption(pLEDCurrentCstmr);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dLEDCrnt = atof(strLEDCrnt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // ------&nbsp; Update the Final Current ------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strFinalCrnt.Format("%.2f", (dDongleCrnt+dLEDCrnt) );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_Report_b4_cnctn.GetRecords()-&gt;GetAt(row)-&gt;GetItem(COLUMN_FINAL_CRNT)-&gt;SetCaption(strFinalCrnt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Customer LED Current has changed<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if (col == COLUMN_USER_LED_CRNT)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strLEDCrnt = pItemNotify-&gt;pItem-&gt;GetCaption(pLEDCurrentCstmr);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //strLEDCrnt = pItemNotify-&gt;pItem-&gt;GetItemData();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dLEDCrnt = atof(strLEDCrnt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strDongleCrnt = m_Report_b4_cnctn.GetRecords()-&gt;GetAt(row)-&gt;GetItem(COLUMN_DONGLE_ACTIVE)-&gt;GetCaption(pDongleCurrent);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dDongleCrnt = atof(strDongleCrnt);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // ------&nbsp; Update the Final Current ------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strFinalCrnt.Format("%.2f", (dDongleCrnt+dLEDCrnt) );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_Report_b4_cnctn.GetRecords()-&gt;GetAt(row)-&gt;GetItem(COLUMN_FINAL_CRNT)-&gt;SetCaption(strFinalCrnt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Final Current column has changed<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if (col == COLUMN_FINAL_CRNT )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strFinalCrnt = pItemNotify-&gt;pItem-&gt;GetCaption(pFinalCurrent);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //strFinalCrnt = pItemNotify-&gt;pItem-&gt;GetItemData();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dFinalCrnt = atof(strFinalCrnt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strLEDCrnt = m_Report_b4_cnctn.GetRecords()-&gt;GetAt(row)-&gt;GetItem(COLUMN_USER_LED_CRNT)-&gt;GetCaption(pLEDCurrentCstmr);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dLEDCrnt = atof(strLEDCrnt);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // ------ Update the Dongle Current ------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strDongleCrnt.Format("%.2f", (dFinalCrnt - dLEDCrnt));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_Report_b4_cnctn.GetRecords()-&gt;GetAt(row)-&gt;GetItem(COLUMN_DONGLE_ACTIVE)-&gt;SetCaption(strDongleCrnt);</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; m_Report_b4_cnctn.Populate();<BR>&nbsp;&nbsp;&nbsp; m_Report_b4_cnctn.RedrawControl();<BR>&nbsp;&nbsp;&nbsp; m_Report_b4_cnctn.AllowEdit(TRUE);<BR>&nbsp;&nbsp;&nbsp; m_Report_b4_cnctn.FocusSubItems(TRUE);<BR>&nbsp;m_Report_b4_cnctn.SetFocus();</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 08 Sep 2008 18:24:44 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12105&amp;PID=40819&amp;title=bug-in-updating-report-control#40819</guid>
  </item> 
 </channel>
</rss>