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

Powerbuilder, delete column?

Status
Not open for further replies.

allany

Programmer
Jan 14, 2005
10
GB
Hi all,

I have a a datawindow called eg dw_data1 and this shows 3 columns of data and an invisible column containing IDs.

I have a window called w_report_viewer which holds my w_data1.

There is a save button that saves the data to an excel file, and the problem is, when the user presses save, it saves all the data in the data window, EVEN the invisible column of data which is not desirable. How can i go around this?

Is there a way to save only a selection of columns? is there a way to delete the column into a temp window or something then put it back after the save is completed/failed/cancelled?

My knowledge of pb is a bit limited, using existing code at the moment. please help. thank you.
 
What is the invisible column used for? If, for example, it is used for sorting purposes, remove it entirely from the datawindow and perform the sort in the data retrieval statement.

If the column has a purpose which prevents its removal from the datawindow, create a datastore, use the same datawindow object but without the invisible column, share the data from the displayed datawindow, and then use the datastore to create the excel file. Check out the help under the 'sharedata' method.

Matt

"Nature forges everything on the anvil of time
 
Thanks!

However, just to clarify. The invisible column contains data which is used to load up another window, the column is indeed required.

There is a hyperlink on the 3rd (visible) column, when a user clicks on this link, it will open up a new window taking the corresponding value from the invisible column.

Is it still possible to use the method you suggested, and could you provide a bit more detail? even code syntax. thanks again!
 
Hi,

I have decided to just delete the column, however, before i delete it, i created an array to contain the values.

What i was thinking is, once the user presses "save", the column gets deleted. After it is completed (save), then replace the column with the data.

Replacing the data is not a problem, but it is the column title itself....

I used dw_window.Object.Modify("CREATE columnName") but that didn't work.... any ideas?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top