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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Column Creation

Status
Not open for further replies.

thekl0wn

Programmer
Jan 12, 2006
292
US
I'm wanting to dynamically create column in my datawindow. I'll be using the DataWindow.Create( String syntax ) funtion to create them. Basically, my question comes into play here: To create a new column, I basically only need to add the code in the SQL statement and in the table definition, unless I want it to be a visual... which would also require it in the objects list as well.... Correct?
 
After playing around with it for a bit, I answered my own question. I'm pulling the syntax into a local string variable from the dw_rpt.Object.DataWindow.Syntax. Through a few crafty string manipulations I break down the string, and add in the new columns into the table( ) definition, and also into the retrieve( SQL ).
 
Another tip I've found so far is that you should call the dwcontrol.GroupCalc( ) function right after the dwcontrol.Create( ) function. It only took me 3 days to figure that one out!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top