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...datawindow describe and computed fields
li_max = Integer(dw.Object.DataWindow.Column.Count)
for li_col = 1 to li_max
ls_colname = dw.describe("#" + String(li_col) + ".Name")
The above snippet of code yields the fields in a datawindow, but does not
list computed columns. How do I get computed columns to be listed using the
Look at dw_1.describe("datawindow.objects")
"Mark Schupay" <firstname.lastname@example.org> wrote in message
> li_max = Integer(dw.Objec...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 ~~&...Modify () to Change String Expression For computed Fields.
I am trying to change the expression for a computed field using
Modify (). It works fine if I change it to a numeric expression
but if I change it to String expression, it fails. Probably the
syntax I am using to define the Modify string is wrong.
ls_Modify = "cf_test.Expression = 'A" + String (li_Number) + "'"
This results in an error.
Remember that in
ls_Modify = "cf_test.Expression = 'A" + String (li_Number) + "'&qu...Datawindow Expression/Describe/Modify Builder (auto-tilde)
How about a way of simplifying the usage of those angry little gnomes we
know as tildes. Maybe I just have a mental block but for the number of years
I've been using PB, I *should* be able to code an expression with them
without a problem. However, it's like I know where they should go but I
don't think I've ever been able to figure-out exactly how many I need before
a string delimiter when doing something complex (like nesting inside an
Evaluate() or Describe()) on the first shot.
Backward compatibility dictates we use them the same way we used them in the
past but ...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...computed field height in datawindow's detail band gets truncated
This is a multi-part message in MIME format.
Hello All -
I have a computed field in a datawindow report which is a function that =
lists the names of guests for an invitee in an Event.
I have set Autosize Height property for the the computed field and the =
For some reason the last guest name in the list gets truncated.
I use Powerbuilder 7.0.3 version.=20
Earlier, someone on this forum suggested to minimize as much...computed field expression
I have this statement but it is not producing the desired results.
I have 2 computed fields that are supposed to get the total amount for cash
and the total for credit.
compute_1: If( payment_payment_form <> 'cash', sum( payment_amount for
compute_2: If ( payment_payment_form ='cash, sum( payment_amount for all),0)
Obviously this aboue just produces the total for both cash and credit.
I can't get the syntax right but I need something like;
If ( payment_payment_form ='cash, sum( payment_amount for all) where
payment_form = cash,0)
Any ideas?...Datawindow Describe / Modify.
I have 2 columns col-1, col-2 and 5 rows in a datawindow and I
want the attributes of col-1 to change when the user clicks on
it. Also, col-1 has 0 taborder.
For instance, when user clickes on the col-1 in the 3 row, I
want its color to change only in the third row. When I try to
change the color, it changes for that col-1 but in all 5 rows.
In short, can I use describe() and modify() for a particular row
and column ?
This same topic was covered just recently in another threa...Computed field expression: AND or OR
Just had a strange problem.
In a computed field expression I placed following statement:
(Value of prc_discount = 0 )
- IF( NOT IsNull( prc_discount ) AND prc_discount <> 0, 'Show text',
'' ) --> Result = 'Show text'
Now by changing the expression to:
- IF( IsNull( prc_discount ) OR prc_discount = 0, '', 'Show text' ) -->
Result = ''
Can someone explain this behaviour, because I'm totally lost.
(PB 8.0.1 Build 9056 on a W2K workstation)
just a shot in the dark:
...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=...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 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:email@example.com...