Syntax 1: For graph objects
Description
Saves the data in a graph in the format you specify.
Applies to
Graph controls in windows and user objects, and graphs in
DataWindow controls and DataStores
Syntax
|
1 |
controlname.SaveAs ( { filename, } { graphcontrol, saveastype, colheading { , encoding } } ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the graph control whose contents you want to |
|
filename (optional) |
A string whose value is the name of the file in which |
|
graphcontrol (DataWindow control only) (optional) |
A string whose value is the name of the graph in the |
|
saveastype (optional) |
A value of the SaveAsType enumerated datatype specifying
Obsolete values The following SaveAsType values are considered to be |
|
colheading (optional) |
A boolean value indicating whether you want column |
|
encoding (optional) |
Character encoding of the file to which the data is
|
Return value
Integer.
Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, SaveAs returns null.
Usage
You must use zero or three arguments. If you do not specify any
arguments for SaveAs, PowerBuilder displays the Save As dialog box,
letting the user specify the format of the saved data.
Regional settings
If you use date formats in your graph, you must verify that yyyy
is the Short Date Style for year in the Regional Settings of the
user’s Control Panel. Your program can check this with the RegistryGet
function.
If the setting is not correct, you can ask the user to change it
manually or to have the application change it (by calling the
RegistrySet function). The user may need to reboot after the setting
is changed.
Examples
This statement saves the contents of the graph gr_History. The
file and format information are not specified, so PowerBuilder prompts
for the file name and save the graph as tab-delimited text:
|
1 |
gr_History.SaveAs() |
This statement saves the contents of gr_History to the file
G:HREMPLOYEE.HIS. The format is CSV without column headings:
|
1 |
gr_History.SaveAs("G:HREMPLOYEE.HIS" ,CSV!, FALSE) |
This statement saves the contents of gr_computers in the
DataWindow control dw_equipmt to the file G:INVENTORYSALES.XLS. The
format is Excel with column headings:
|
1 2 |
dw_equipmt.SaveAs("gr_computers", & "G:INVENTORYSALES.XLS", Excel!, TRUE) |
See also