Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add dynamically a column

Status
Not open for further replies.

lolo327

Programmer
Nov 25, 2003
14
0
0
GB
Hello all,

Is it possible to add dynamically a column to a datawindow (type is grid).

I would like to avoid to use the CREATE function that will force me to work with the syntax.

Thanks for your help
 
This can be done using the Modify method.
First get the correct syntax to add the column(s) to the DW.The best way to do this is to create a DW with the columns you want and then export it. You can find the correct syntax in the .SRD.

Next, in the code, add the column syntax to a variable.

eg. ls_cols = ls_cols + " column=(type=char(40) name=" + ls_new_col + " dbname=~'" + ls_new_col + "~' )"

where ls_new_col is the name of the column you want to add. You can add more than one column at a time by looping through and adding to ls_cols.

Final step is the modify:
ls_rc = dw_merge_data.Modify("table(" + ls_Cols + ")" )

Hope this helps

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top