Saves the data in a graph in the format you specify.
PowerBuilder DataWindow DataWindow control
integer dwcontrol.SaveAs ( string graphcontrol {, string filename, SaveAsType saveastype, boolean colheading { , encoding } } )
Argument |
Description |
---|---|
dwcontrol |
A reference to the DataWindow control containing the graph. |
graphcontrol |
A string whose value is the name of the graph in the DataWindow control. |
filename (optional) |
A string whose value is the name of the file in which you want to save the data in the graph. If you omit filename or specify an empty string (“”), the user is prompted for a file name. |
saveastype (optional) |
A value of the SaveAsType enumerated datatype (in PowerBuilder) or an integer (for the Web ActiveX) specifying the format in which to save the data represented in the graph. For a list of values, see SaveAsType. |
colheading (optional) |
A boolean value indicating whether you want column headings with the saved data. The default value is true. This argument is used for the following formats: Clipboard, CSV, Excel, and Text. For most other formats, column headings are always saved. |
encoding (optional) |
Character encoding of the file to which the data is saved. This parameter applies only to the following formats: TEXT, CSV, SQL, HTML, and DIF. If you do not specify an encoding parameter, the file is saved in ANSI format. Values are:
|
Returns 1 if it succeeds and -1 if an error occurs. If any argument’s value is null, SaveAs returns null.
If you do not specify any arguments, PowerBuilder saves the DataWindow data rather than the data in the graph control. In this case, or in the case where you specify only the graph control name as an argument, PowerBuilder displays the Save As dialog box, letting the user specify the format of the saved data.
The Web ActiveX is a safely scriptable control and does not take actions that can affect the client’s environment. Therefore, it does not support SaveAs.
PowerBuilder This statement saves the contents of gr_computers in the DataWindow control dw_equipmt to the file G:\INVENTORY\SALES.XLS. The format is comma-separated values with column headings:
dw_equipmt.SaveAs("gr_computers", &
"G:\INVENTORY\SALES.XLS", CSV!, true)