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

Saving Datawindow object as TEXT file

Status
Not open for further replies.

Kuttipulikal

Programmer
Feb 26, 2002
5
IN
Hi Friends,
I am using PB5.0. I wanted to save a report as text file including its format and computed fields. When I use dw.SaveAS() I used to get base SQL saved as text file. Can anyone help me to solve this problem.
Thanks in advance ,
Kuttipulikal
 
The only "Save As" types which display the entire datawindow as displayed onscreen are "HTML Table" and "PowerSoft Report". The latter produces a .PSR file which can only be read by PowerBuilder or an application which makes use of the PowerSoft PSR viewer.
The former produces an HTML file. The HTML is pretty crude. You can get slightly better HTML if prior to saving the datawindow you set dw_1.Modify("DataWindow.HTMLTable.GenerateCSS = 'yes'").
This is the ugly truth.
A more elaborate method is to share the data between the datawindow and an RTF Edit control which you have designed to resemble the datawindow. The RTF Edit control will save as viewed.
 
Try this

dw_History.SaveAs("G:\INVENTORY\EMPLOYEE.HIS", &

CSV!, FALSE)

Just replace the CSV! with Text! and whatever your file name is going to be, it should solve your problem. I got this from PB 7.03 help. But it should work in 5.0 as well.

HTH
Dan
 
Thank U very much friends...
I will try to share datawindow and RTF edit control.
About HTML table.
I haven't seen it in PB5.0. I think Its in higher versions.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top