06-20-2005 09:42 AM
06-21-2005 02:01 AM
06-27-2005 09:18 AM
06-28-2005 12:28 PM
06-29-2005 01:40 AM
06-29-2005 08:19 AM
03-13-2007 09:56 AM
Is it possible to change the property of a channel in Report depending on its value?
This is what the statement looks like in Report,
: @str(ChnPropGet("[1]/Accel Peakge60","e60"),'dd.ddd')@ g
If the value goes over 20, I would like it to change colour.
Thanks
03-14-2007 09:25 AM
Hello Stagsden,
The following code should do what you want. Please change the "Text1" parameter to the name of the text object you are using to display the channel property you are referring to.
IF ChnPropGet("[1]/Accel Peakge60","e60") > 20 THEN
Call GraphObjOpen("Text1")
TXTCOLOR ="red"
Call GraphObjClose("Text1")
END IF
Let us know if you have any more questions,
Otmar
03-14-2007 10:07 AM
I'm not sure if this is any easier for you, but an alternate method would involve registering a user command like the script below and in a REPORT text object using the following as your text:
@@MyResultText("Text2", "MyChannelName", "maximum", 250)@@
Where "Text2" is the REPORT text object name, "MyChannelName" is the channel you are referencing.
There may be easier ways to do this also, but this is similar to how I use "conditional formatting" in DIAdem.
'---script begin---
Option Explicit 'Forces the explicit declaration of all the variables in a script.
Call ScriptCmdAdd(AutoActFile) ' Adds the user command
Public Function MyResultText(TextObjName, ChanName, ChnProp, DNEValue)
Dim ChnPropValue
ChnPropValue = ChnPropValGet(ChanName, ChnProp) ' note that ChnPropValGet only works in DIAdem 10.1 +
' Change the font properties for values greater than DNEValue
Call GraphObjOpen(TextObjName)
If ChnPropValue > DNEValue Then
TxtColor = "red"
Else
TxtColor = "green"
End If
Call GraphObjClose(TextObjName)
MyResultText = Str(ChnPropValue,"d.dd")
End Function
'---script end---
03-14-2007 12:31 PM
I think that should work when I have renamed all of my objects in Report, as I have about 20 text objects and none of them have unique names.
Or can I call them individually by their channel property.
Thanks