<?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 : Strange behavior when trying to SetCaption</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : Strange behavior when trying to SetCaption]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 18 Apr 2026 14:58:32 +0000</pubDate>
  <lastBuildDate>Sat, 22 Aug 2009 10:20:29 +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=15024</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[Strange behavior when trying to SetCaption : CXTPReportRecordItemText allow...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15024&amp;PID=52310&amp;title=strange-behavior-when-trying-to-setcaption#52310</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 15024<br /><strong>Posted:</strong> 22 August 2009 at 10:20am<br /><br />CXTPReportRecordItemText allow to use in-place-edit control with validation and user choice to escape in any point including one - select content - (Ctrl+A) - cut it (Ctrl+C) - escape - and Core should restore old value!]]>
   </description>
   <pubDate>Sat, 22 Aug 2009 10:20:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15024&amp;PID=52310&amp;title=strange-behavior-when-trying-to-setcaption#52310</guid>
  </item> 
  <item>
   <title><![CDATA[Strange behavior when trying to SetCaption : SetValue (with casting to *text)...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15024&amp;PID=52305&amp;title=strange-behavior-when-trying-to-setcaption#52305</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=760">dennisV</a><br /><strong>Subject:</strong> 15024<br /><strong>Posted:</strong> 22 August 2009 at 4:23am<br /><br />SetValue (with casting to *text) seems to do the trick!<br><br>Thanks,<br><br>Dennis<br>]]>
   </description>
   <pubDate>Sat, 22 Aug 2009 04:23:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15024&amp;PID=52305&amp;title=strange-behavior-when-trying-to-setcaption#52305</guid>
  </item> 
  <item>
   <title><![CDATA[Strange behavior when trying to SetCaption : Check your item type - (CXTPReportRecordItem...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15024&amp;PID=52304&amp;title=strange-behavior-when-trying-to-setcaption#52304</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 15024<br /><strong>Posted:</strong> 22 August 2009 at 2:06am<br /><br /><DIV>Check your item type - (CXTPReportRecordItem or CXTPReportRecordItemText&nbsp;or other derived types) </DIV><DIV><FONT size=2><FONT size=2><DIV>Compare 2 cases on initialization</DIV><DIV><FONT size=2><P></FONT><FONT size=2><FONT color=#000000>1 - AddItem(new CXTPReportRecordItemText("ABC")); //&nbsp;this case will not allow empty string to set as caption because "ABC" will be default value.</P><DIV></FONT></FONT><FONT size=2>2 - AddItem(</FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> CXTPReportRecordItemText())-&gt;SetCaption("ABC"); //this case will&nbsp;allow empty string to set as caption as default value now - empty string</DIV><DIV>&nbsp;</DIV><DIV>btw - you can use more simple function: <FONT color=#0000ff><FONT size=2>GetReportCtrl().SetCellText(Row#, Col#, </FONT><FONT size=2>Text</FONT><FONT size=2>);</FONT></FONT></DIV><DIV>&nbsp;</DIV></FONT></DIV><DIV>CXTPReportRecordItemText::CXTPReportRecordItemText(LPCTSTR szText) : CXTPReportRecordItem(), m_strText(szText) { }</DIV><P>&nbsp;CString CXTPReportRecordItemText::GetCaption(CXTPReportColumn* </FONT><FONT color=#008000 size=2>/*pColumn*/</FONT><FONT size=2>) {</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (!m_strCaption.IsEmpty()) </FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> m_strCaption;</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (m_strFormatString == _T(</FONT><FONT color=#a31515 size=2>"%s"</FONT><FONT size=2>)) </FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> m_strText;</P><P>CString strCaption;</P><P>strCaption.Format(m_strFormatString, (LPCTSTR)m_strText);</P><P></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> strCaption;</P><P>}</P></FONT><FONT color=#0000ff size=2><P>void</FONT><FONT size=2> CXTPReportRecordItemText::OnEditChanged(XTP_REPORTRECORDITEM_ARGS* pItemArgs, LPCTSTR szText) {</P><P>SetValue(szText);</P><P>CXTPReportRecordItem::OnEditChanged(pItemArgs, szText);</P><P>}</P></FONT><FONT color=#0000ff size=2><P>void</FONT><FONT size=2> CXTPReportRecordItemText::DoPropExchange(CXTPPropExchange* pPX) {</P><P>CXTPReportRecordItem::DoPropExchange(pPX);</P><P>PX_String(pPX, _T(</FONT><FONT color=#a31515 size=2>"Text"</FONT><FONT size=2>), m_strText, _T(</FONT><FONT color=#a31515 size=2>""</FONT><FONT size=2>));</P><P>}</P></FONT></FONT><FONT size=2></FONT></DIV>]]>
   </description>
   <pubDate>Sat, 22 Aug 2009 02:06:17 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15024&amp;PID=52304&amp;title=strange-behavior-when-trying-to-setcaption#52304</guid>
  </item> 
  <item>
   <title><![CDATA[Strange behavior when trying to SetCaption : Hello,I&amp;#039;m observing strange...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15024&amp;PID=52302&amp;title=strange-behavior-when-trying-to-setcaption#52302</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=760">dennisV</a><br /><strong>Subject:</strong> 15024<br /><strong>Posted:</strong> 21 August 2009 at 10:38pm<br /><br />Hello,<br><br>I'm observing strange behavior - I populate my records as normal, then one record is changed and I use:<br><br>pRecord-&gt;GetItem(9)-&gt;SetCaption(strCaption);<br><br>to update the displayed text, which does that in all cases, except:<br><br>If GetItem(9) was not an empty string when Populate() was called and I then try to set it with an empty string, it reverts back to the original non-empty value. So, let's say it was "abc" initially, then I call SetCaption(""), it displays "abc".<br><br>Also, I can change it to "def", it displays "def", then I set it to "" and it displays "abc" again.<br><br>Weird <img src="http://forum.codejock.com/smileys/smiley3.gif" border="0" align="absmiddle"> Am I doing something wrong or is there&nbsp; a bug in the control?<br><br>Thanks,<br><br>Dennis<br>]]>
   </description>
   <pubDate>Fri, 21 Aug 2009 22:38:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15024&amp;PID=52302&amp;title=strange-behavior-when-trying-to-setcaption#52302</guid>
  </item> 
 </channel>
</rss>