But how do I write code to check if a column exists without having the
application to crasch.
If I just do a datawindow.getitemstring(1,"column_name"), I get a runtime
error event thought I try to put it in a try catch block as follows
boolean lb_exists
long ll_value
lb_exists = true
try
ll_value = dw_data.getitemnumber(1,"colname")
finally
lb_exists = false
ll_value = -1
end try
if lb_exists = true then
//run additional code
else
//don't run additional code
end if
Please help
/Roger Bertilsson
You can also use Describe( 'colname.id' ). If that returns a "!", your
column doesn't exist.
Paul Horan[TeamSybase]
"Roger Bertilsson" <roger.be...@eniro.com> wrote in message
news:47a9a624$1@forums-1-dub...
It worked fine with describe (colname.type) because it is a computed column.
Now to the next and hopefully the final issue: How can I now change the
value of a computed column at runtime.
I have tried setitem(1,"colname",ll_value) but that rises an error.
I have also tried dwobject.object.colname[1] = ll_value
I have placed the computed column in the header band (thats why I thought I
should use row number 1)
P.S I will use this value from a print dialog to give the user the option to
choose have many pages in horizontal direction that should be printed. That
print dialog should update the computed column and the visible property of
all columns in the dwreport reads that computed column to see whether that
column should be visible or not
/Roger
"Paul Horan[TeamSybase]" <phoran AT sybase DOT com> wrote in message
news:47a9af8c$1@forums-1-dub...
Now, if you want to change the computation itself, you can use Modify() or
dot notation on it.
It sounds like you don't want to use a computed column at all. You should
add a "real" column to the result set by changing the SQL statement and
adding something like ",0 as myNewColumn" (or if it's an external source
dw, just add another column to the result set manually).
Now you can use SetItem( 1, "myNewColumn", 2 ) to change it.
Paul Horan[TeamSybase]
"Roger Bertilsson" <roger.be...@eniro.com> wrote in message
news:47a9c1d9$1@forums-1-dub...
where computefieldname is the compute field name
and ls_expression is whatever you want it to be. make sure you check the return
value of the modify
"Roger Bertilsson" <roger.be...@eniro.com> wrote in message
news:47a9c1d9$1@forums-1-dub...