<?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 : Format$ question</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : Format$ question]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 15 May 2026 07:09:38 +0000</pubDate>
  <lastBuildDate>Thu, 10 Sep 2009 12:54:19 +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=15143</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[Format$ question : Formula support - feature of version...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15143&amp;PID=52916&amp;title=format-question#52916</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 15143<br /><strong>Posted:</strong> 10 September 2009 at 12:54pm<br /><br />Formula support - feature of version 13.2 - no sense to try it with previous versions <DIV>You can set your report to make calc for you without your fired functions</DIV>]]>
   </description>
   <pubDate>Thu, 10 Sep 2009 12:54:19 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15143&amp;PID=52916&amp;title=format-question#52916</guid>
  </item> 
  <item>
   <title><![CDATA[Format$ question : Hi ALL,  newb on the forum and...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15143&amp;PID=52896&amp;title=format-question#52896</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5526">GrinderBR</a><br /><strong>Subject:</strong> 15143<br /><strong>Posted:</strong> 09 September 2009 at 8:47pm<br /><br /><DIV>Hi ALL,</DIV><DIV>&nbsp;</DIV><DIV>newb on the forum and somewhat newb with Codejock components. Using VB6 SP6 and Xtreme Suite Trial 12.0.1</DIV><DIV>&nbsp;</DIV><DIV>My question is about the ValueChanged event of ReportControl. I´m writing an application where the user is supposed to edit directly the contents of the ReportRecordItems, which appears as cells in the ReportControl. After editing the contents of the cell or inputing an value in a blank cell, I understand that first of all the ValueChanging event is fired and after that the ValueChanged event is fired.</DIV><DIV>&nbsp;</DIV><DIV>I also understand that when the ValueChanged event is fired, the contents of the ReportRecorItem associated with the active cell is also updated. So I would like to format the Caption property of this cell AFTER it is updated or input. The value itself will be used to perform running totals calculations and&nbsp;for that I wrote the following code:</DIV><DIV>&nbsp;</DIV><DIV>Private Sub rcCM_ValueChanged(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem)<BR>&nbsp;&nbsp;&nbsp; Dim Record As ReportRecord, NewCol As ReportColumn<BR>&nbsp;&nbsp;&nbsp; Dim Quant As Currency, Price As Currency, Total As Currency<BR>&nbsp;&nbsp;&nbsp; Dim i As Long<BR>&nbsp;&nbsp;&nbsp; </DIV><DIV>&nbsp;&nbsp;&nbsp; 'Perform calculations of subtotals<BR>&nbsp;&nbsp;&nbsp; Set Record = Row.Record<BR>&nbsp;&nbsp;&nbsp; If Record.Item(3).Caption &lt;&gt; "" Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Quant = CCur(Record.Item(2).Caption)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Price = CCur(Record.Item(3).Caption)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Total = Quant * Price<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Record.Item(3).Caption = Format$(Price, "STANDARD")&nbsp; &lt;- Problem!!!<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Record.Item(4).Caption = Format$(Total, "STANDARD")<BR>&nbsp;&nbsp;&nbsp; End If<BR>&nbsp;&nbsp;&nbsp; </DIV><DIV>&nbsp;&nbsp;&nbsp; 'Perform running total calc<BR>&nbsp;&nbsp;&nbsp; TotalMaterial = 0<BR>&nbsp;&nbsp;&nbsp; For i = 0 To 6<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Record = rcCM.Records(i)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TotalMaterial = TotalMaterial + CCur(Record.Item(4).Caption)<BR>&nbsp;&nbsp;&nbsp; Next<BR>&nbsp;&nbsp;&nbsp; lblCustoMaterial.Caption = Format$(TotalMaterial, "STANDARD")<BR>&nbsp;&nbsp;&nbsp; </DIV><DIV>&nbsp;&nbsp;&nbsp; 'Change focus to next row<BR>&nbsp;&nbsp;&nbsp; If Row.Index &lt;= rcCM.Rows.Count - 2 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Column.Index = 2 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set NewCol = rcCM.Columns(3)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rcCM.EditItem Row, NewCol<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ElseIf Column.Index = 3 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set NewCol = rcCM.Columns(2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Row = rcCM.Rows(Row.Index + 1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rcCM.EditItem Row, NewCol<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<BR>&nbsp;&nbsp;&nbsp; End If<BR>End Sub<BR></DIV><DIV>As you can see, the subtotals are calculated right at the beginning of the Sub and it works 100%, even when editing values. If, on the ohter hand, I uncomment the instruction marked as problematic, to format the number in the cell, it doesn´t work anymore. If the cell is blank and a value is input, it works ok, but if there´s already a value and it is edited, after you press Enter the value is returned to the first value that was input in the cell.</DIV><DIV>&nbsp;</DIV><DIV>It doesn´t matter if I reference the cell as in my example or if it is referenced by the Item argument of the event procedure. If I try to format the number and put it back, it doesn´t work as expected.</DIV><DIV>&nbsp;</DIV><DIV>Any ideas?</DIV><DIV>&nbsp;</DIV><DIV>Thanks in advance for any advice you may give!</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 09 Sep 2009 20:47:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15143&amp;PID=52896&amp;title=format-question#52896</guid>
  </item> 
 </channel>
</rss>