CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Is anyone familiar with the inMotion framework. (SOLVED)

Print topic Send  topic

Author Message
rbaldwin

Posts: 172
Posted: 04/02/2012, 5:49 AM

I have a Report Page, the report is named Report1, in the detail row i have a column named AvgScore, how do i:
a) get the current value of AvgScore
b) set AvgScore to a new value

In a non Inmotion report page i would have simply coded:

Dim curValue as String
curValue = Report1AvgScore.Text

Report1AvgScore.Text = "someNewValue"

Your help is appreciated.

And yes i know this should be posted in the inMotion forum, but that forum gets little traffic.
View profile  Send private message
rbaldwin

Posts: 172
Posted: 04/02/2012, 8:33 AM

After some struggling with the examples, here i provide my own solution.

dim avgScore as string
dim averageScore as Double
dim sumOfScores as double = Report1.GetControl(Of MTHidden)("sumOfScores").Value
dim numOfHosts as double = Report1.GetControl(Of MTReportLabel)("Num_Hosts").Value

if numOfHosts = "0" then
avgScore = ""
else
averageScore = sumOfScores / numOfHosts
avgScore = formatNumber(averageScore,0)
end if

CType(sender, MTReportLabel).Text = avgScore
View profile  Send private message
cvboucher

Posts: 191
Posted: 04/02/2012, 8:41 AM

In the BeforeShow event of the AvgScore field you can do the following (VB.Net InMotion).

  
Dim curValue As String = CType(sender, MTReportLabel).Text  
CType(sender, MTReportLabel).Text = "someNewValue"  
Or
  
Dim MyFieldName As MTReportLable = CType(sender, MTReportLable)  
Dim curValue As String = MyFieldName.Text  
MyFieldName.Text = "someNewValue"  
Or
  
Dim curValue As String = Report1.GetControl(Of MTReportLabel)("avgScore").Text  
Report1.GetControl(Of MTReportLabel)("avgScore").Text = "someNewValue"  
Also, for numeric fields I like to set Value property so the formatting is handled for me based on the field properties. If the field's format is set with two decimal places you can
  
CType(sender, MTReportLabel).Value = 82.443453343  
and the field will be formatted on the report with just the two decimal places.

HTH,
Craig
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.