Modifying Computed field Expression
We have a software package that we use in our business, where we have some
control over customizations to the program. We don't have access to window
objects, but we have access to certain datawindows and global functions.
One global function runs when a window refreshes. The function contains a
choose case statement to determine which window is opening. It then runs
the script for that window.
I have a computed field on a datawindow that just has an Expression of 0. I
want to be able to have the Expression for the computed field get modified
through this fun...changing computed field expression
I am trying to change the expression of a computed field in a DW using both
or dot notation
dw_1.object.compute_4.expression = "text"
but it does not work. Is this posible with PB9
That doesn't work because there is no column named text. You need an
*expression*, such as a literal surrounded by quotes.
"Jon" <firstname.lastname@example.org> wrote in message news:404854a6@forums-1-dub...
> I am try...modify expressions in computed fields ?
Can i modify expressions in computed fields depends on the
value in a column like other properties like color
(exam: text.Color='0~t If (formel_id =1 ,255,0)' )??
thats my test_modstring:
c_test.Expression='0~tIf(formel_id =1 ,1+1,0)'
i have only Syntax error at the last column.
Thank you very much!
Sure you can. Off hand your syntax looks ok. Replace "forme1_id" with a
constant and see if it accepts the syntax:
First get it working in the DW painter. Then copy that syntax out and use it
in your modify.
...How to Modify computed field expression on Runtime?
I've a computed field with the Expression='No. '+String(getrow()).
My question is with dw1.Modify(compute1 + ".Expression='No.
'+String(getrow())") how can we put the quotes in the correct syntax. I
always get an syntax error.
Have you tried:
<DW Control Name>.Modify("<ComputedFieldname>.Expression='<expression>'")
Maybe i didn't explained myself.
The problem was the quotes when you want to do something like this:
dw1.Modify("compute_01.Expression='~~'Register ~~&...Dinamically change an expression in a computed field
Have anybody tried to change the expression of a computed field in runtime,
using the Modify Expression dialog box of the datawindow painter?? How can I
use this dialog box in an script??
You can't use this dialog box in script.
Dawn T Brown Eyes (TeamSybase)
Juan Rivera <email@example.com> wrote in article
> Have anybody tried to change the expression of a computed field in
> using the Modify Expression dialog box of the datawindow painter?? How
> use this...Describe/Modify Height Expression of Computed Field
How can I modify the height expression of a computed field
on a grid datawindow (and then set it back) at runtime? The
height is set to the height of all the columns on the grid
(64), with rowheight() as the expression.
When the datawindow is saved in HTMLTable format (as part of
our routine to open the datawindow in Excel), this height
expression results in a blank row between datawindow rows.
Using Describe gets only the height value, not the
Is there a way to get the height (including the expression),
remove the expression (then save in HTMLTable format), then
r...Change value of a field from a Computed Field
Hi all !
I need to put a value to a one field from a computed field.
I try this in the expression of computed field: ( field_to = value of
But the result is "TRUE" or "FALSE".
My question: the computed field is able to modify a value of another field ?
How i do this ? (If possible)
Thanks in advance.
If you are asking if you can place a value in the primary buffer using only
datawindow expressions, the answer is no. You will have to do this in
If you just want to display something when another fi...computed field of a computed field
I made nice datawindow with some aggregate functions to calculate a certain
value at a group level.
Now I want a grand total which gives me the sum of these values.
Unfortunately this does not seem to be possible. So, when I have a computed
field which is round (sum(file_field),0) located in the trailer band, I need
a grand total of this field in the summary band. Does anyone know how to
solve this ?
in the group , you must have created a computed field having expression
sum ( file_field ) for group 1
In the summery, y...String expression within string expression
I have coded script that dynamically builds a where clause. This to simulate
query mode in a 3-tier application.
Somewhere in that code I have the following lines:
CHOOSE CASE UPPER(ls_coltype)
CASE "CHAR", "STRING"
ls_WhereClause += " LIKE '" + la_coldata + "'"
The entire code works perfectly. Except for the case where the columntype is
String and the value (la_coldata) has a single quote in it. So you would get
something like this:
ls_WhereClause += " LIKE '" + "he's" + &qu...Modify Computed Field
i would like to modify a computed field in a datawindow who
is in the footer band.
When i try :
dw_trombinoscope.object.t_droite.Expression = "Page : " +
I've the message :
Error Accesing external object property expression at line
That code looks OK to me. Are you sure it is a computed field and not a
static text? t_ is usually the naming convention for a static text, which
does not have an Expression property.
<ed> wrote in message news:firstname.lastname@example.org...
>...Modify compute expression
i have a problem regarding a computed field that has to reference a field
dynamically at runtime. This computed field also has a group on it which
forces a pagebreak.
Now the problem is that i set the value on the computed field to 0 in the
painter, so that no pagebreak occurs. When i wan't to have the pagebreak i
try to modify the compute expression field, but nothing happens. The way i
do it is as follows:
dw_okorapport.Modify("sideskift.Expression=' sortniveau '")
dw_okorapport.Object.sideskift.Expression = " sortniveau "
...Modify with datawindow expression
This doesn't seem to work. I've done a Describe to get the
syntax of the expression I have for the width of a column
and am trying to set new values into the string and modify
the column. I get "incorrect syntax". Here's my string
returned from the Describe:
"837 if(sales_ind = 'Y',709, 837)"
And here is my modified string:
s_width_string = "~'0~tif(sales_ind = ~'Y~',"+string(i_v_w -
And here's my modify command:
s_errors = this.Modify( 'datetime_value.width=...Computed field expressions
I have a problem with computed expressions. I am replacing
occurence of a particular string in a computed field with
another string( say from 'mm/dd/yy ' to 'dd/mm/yy') using
powerscript and when I try to modify the expression it works
in some cases and fails in other cases. For ex
ls_syntax = ls_computename + ".Expression = " + "'"+
ls_expression + "'"
In the above I get a Modify Syntax error in some cases.
Therefore, I need a universal syntax that would work under
all cases. Does a...Value of a computed field doesn't changed after changes to one of their sources
Hi, I have a problem with a computed field in my datawindow. I need to know
a specific amount which is the result of the summatory of the values of a
computed field in every row in my dw. It seemed easy to me at first. I
created a computed field in the detail band which must consider four
different factors which were each included in a static text except for the
last one which has its own computed field. Three of them won't be changed
once they are assigned. But the last one changes every time I change a value
in another dw. What I do once this value is changed by the user is this: