Home > Archive > Clarion > June 2006 > Changing Value Of Report Control Dynamically @ Runtime
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Changing Value Of Report Control Dynamically @ Runtime
|
|
| Suntower 2006-06-24, 7:55 am |
| I am trying to use CHANGE() in a report to change the -value- of a
control
at runtime, but this does not seem to work. Any suggestions?
Eg...
LOC:MyControl = 'Old Text'
LOC:FEQ = ?LOC:MyControl
! The following simply blanks out the control on the displayed report
SETTARGET(Report)
CHANGE(LOC:FEQ, 'New Text')
SETTARGET()
Any ideas on how to do this? (No, I can't simply change the value of
LOC:MyControl in the code. The idea is to be able to do this
dynamically @
runtime based on what the user wants to do.)
Thanks!
---JC
| |
| Udo Cizelj 2006-06-24, 7:55 am |
| SETTARGET(Report)
?LOC:MyControl{Prop:Text}= 'New Text'
SETTARGET()
HTH
--
Udo Cizelj
Maribor, Slovenia
udo.cizelj@amis.net
CW6.3PE,WinXPprof,SP2
"Suntower" <mail@suntowersystems.com> wrote in message
news:1151012515.241944.306750@g10g2000cwb.googlegroups.com...
>I am trying to use CHANGE() in a report to change the -value- of a
> control
> at runtime, but this does not seem to work. Any suggestions?
>
> Eg...
>
> LOC:MyControl = 'Old Text'
>
> LOC:FEQ = ?LOC:MyControl
>
> ! The following simply blanks out the control on the displayed report
> SETTARGET(Report)
> CHANGE(LOC:FEQ, 'New Text')
> SETTARGET()
>
> Any ideas on how to do this? (No, I can't simply change the value of
> LOC:MyControl in the code. The idea is to be able to do this
> dynamically @
> runtime based on what the user wants to do.)
>
> Thanks!
>
> ---JC
>
| |
| Suntower 2006-06-24, 7:55 am |
| ---But that appears to only work for non-variable strings. I want to be
able to assign a new value to controls which refer to -variables-.
---JC
Udo Cizelj wrote:[color=darkred]
> SETTARGET(Report)
> ?LOC:MyControl{Prop:Text}= 'New Text'
> SETTARGET()
>
> HTH
> --
> Udo Cizelj
> Maribor, Slovenia
> udo.cizelj@amis.net
> CW6.3PE,WinXPprof,SP2
>
> "Suntower" <mail@suntowersystems.com> wrote in message
> news:1151012515.241944.306750@g10g2000cwb.googlegroups.com...
| |
|
| If you assign a value to a variable during code execution,
PRINT(RPT:Detail) will print the newly assigned value, so CHANGE is
unnecessary. I assume you can also:
?LOC:myvar{PROP:Text} = 'newvalue'
HTH,
Paul
Suntower wrote:[color=darkred]
> ---But that appears to only work for non-variable strings. I want to be
> able to assign a new value to controls which refer to -variables-.
>
> ---JC
>
>
>
> Udo Cizelj wrote:
| |
| Suntower 2006-06-24, 7:55 am |
| ---Like I said. This appears to work only for constant strings; -not-
for local vars or field vars. I want to be able to change the value of
a local var or field var @ run time, just like you can do in a window
(which -does- work using CHANGE(), of course.)
Any other ideas?
THANKS!
---JC
uds0 wrote:[color=darkred]
> If you assign a value to a variable during code execution,
> PRINT(RPT:Detail) will print the newly assigned value, so CHANGE is
> unnecessary. I assume you can also:
> ?LOC:myvar{PROP:Text} = 'newvalue'
>
> HTH,
> Paul
>
>
> Suntower wrote:
| |
|
| LOC:Variable = '*** Final Page ***' !!! Change the
value of variable in case the control is variable
Report$?Control{PROP:TEXT} = LOC:Variable2 !!! change the
text of constant with property - any property can be changed like this
PRINT(RPT:Detail:15) !!! Print the detail band
This seems working for me - see if it helps
Regards
Kintu
Suntower wrote:[color=darkred]
> ---Like I said. This appears to work only for constant strings; -not-
> for local vars or field vars. I want to be able to change the value of
> a local var or field var @ run time, just like you can do in a window
> (which -does- work using CHANGE(), of course.)
>
> Any other ideas?
>
> THANKS!
>
> ---JC
>
>
>
> uds0 wrote:
| |
| Didier 2006-06-26, 6:55 pm |
| You need to set the USE attribut of the variable.
In the variable field name change
'Myvar'
to
' MyVar,,?MyVar' ! notice the double ,,
You can then refer to it in the code given in a previous posting.
Didier
Suntower wrote:[color=darkred]
> ---But that appears to only work for non-variable strings. I want to be
> able to assign a new value to controls which refer to -variables-.
>
> ---JC
>
>
>
> Udo Cizelj wrote:
| |
| Suntower 2006-06-29, 6:55 pm |
| What version of Clarion are you using? This definitely does -not- work
for -me- in C5.5. All PROP:Text does is change the 'picture'
(formatting) of a control, not the contents of the control. In the
example you give, therefore, the control will print nothing since the
PROP:Text assignment is not a valid picture format.
Anyone else?
---JC
Kintu wrote:[color=darkred]
> LOC:Variable = '*** Final Page ***' !!! Change the
> value of variable in case the control is variable
> Report$?Control{PROP:TEXT} = LOC:Variable2 !!! change the
> text of constant with property - any property can be changed like this
>
> PRINT(RPT:Detail:15) !!! Print the detail band
>
>
> This seems working for me - see if it helps
>
> Regards
> Kintu
>
> Suntower wrote:
|
|
|
|
|