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 |
|
|
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!
|
|
|
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 |
|
|
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;
|
|
|
|