CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 [Resolved] javascript math with a CCS ReportLabel

Print topic Send  topic

Author Message
jsmonkey


Posts: 39
Posted: 11/09/2010, 6:48 AM

I am trying to calculate some report values in a CCS Report. I thought I could grab the value of a Report Label to do this in javascript but it is not working for me:

my report label is: TotalCount_assngBy

I tried: (document.getElementById("TotalCount_assngBy").value) - I get Object Required error

and I also tried: (document.getReportLabel("TotalCount_assngBy").value) - I get Object not supported error.

Can you help me?

_________________
-J
View profile  Send private message
mljonzs

Posts: 124
Posted: 11/09/2010, 10:32 AM

You can't really get the value off of a label field. Instead, add an additional hidden field for the value and use that field instead. That should work for you.

~michelle
_________________
What does not begin WITH God, will end in failure!
View profile  Send private message
jsmonkey


Posts: 39
Posted: 11/09/2010, 11:52 AM

Thanks Michelle, you are right; Javascript would not work for this. In a different route, I found some code in the Example Pack 2, Time-Sheet report project that did it (it's report calculations for overtime were very similar to what I wanted). The nutshell fix was this:

I added 'myLabel' to the report footer, then added a BeforeShow server event custom code to myLabel :

'Custom Code @86-73254650
' -------------------------
myReport1.myLabel.value = myReport.TotalCount_columnA.value / myReport.TotalCount_columnB.value

' -------------------------
'End Custom Code


I am marking this as [resolved] HOWEVER; If anyone wants to add WHY this works, please comment!
_________________
-J
View profile  Send private message
datadoit
Posted: 11/09/2010, 1:50 PM

You may be able to grab the label value via:

var LabelValue = document.getElementById("TotalCount_assngBy").innerHTML;

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.