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!

Export using SaveAs method(datawindow)

Status
Not open for further replies.

paul102384

Programmer
Oct 5, 2007
30
hi all to all pb programmers:

Using SaveAs method(datawindow) function to export a data, Is it possible to export a data
coming from two different datawindow control and datawindow? Also I want to save the data coming from
two different datawindow in one filename...Can someone give me a sample codes to do this.
Thanks!
 
What type of file are you trying to save it as? I'm not aware of being able to save two datawindows to the same file... Not saying it can't be done, I just haven't seen it (yet). If you're going to a spreadsheet, namely Excel, you could create an OLE object and create pages (tabs) and plug your data in separately. Just a suggestion.
 
Hi,

This can be done only if no. of columns and type of columns (and probably sequence too) are same in both dw.

Add one additional computed column to both dw. Set value = 1 for first dw and set value = 2 for second dw.

//copy all rows from dw_2 to dw_1
dw_2.RowsCopy (1,dw_2.rowcount(),Primary!,dw_1,999999999,Primary!)

//save content in any desired format.
dw_1.SaveAs ()

// Move all rows copied from dw_2 to filter buffer
dw_1.SetFilter ("compute_column = 1")
dw_1.Filter ()

// Discard all rows if required
dw_1.RowsDiscard (1,999999999,Filter!)

remove compute column using modify function from both dw.

Regards,
Abhijit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top