Syntax 1 For graph objects
Description
Saves the data in a graph in the format you specify.
Controls
Graph controls in windows and user objects, and graphs in
DataWindow controls and DataStores
Syntax
1 |
<span>controlname</span>.<span>SaveAs</span> ( { <span>filename</span>, } { <span>graphcontrol</span>, <span>saveastype</span>, <span>colheading</span> { , <span>encoding</span> } } ) |
Argument |
Description |
---|---|
controlname |
The name of the graph control whose contents |
filename |
A string whose value is the name of the |
graphcontrol (DataWindow control |
A string whose value is the name of the |
saveastype (optional) |
A value of the SaveAsType enumerated
Obsolete values
The following SaveAsType values are considered to be obsolete |
colheading (optional) |
A boolean value indicating whether you |
encoding (optional) |
Character encoding of the file to which
|
Return Values
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.
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.<span>SaveAs</span>() |
This statement saves the contents of gr_History to
the file G:HREMPLOYEE.HIS.
The format is CSV without column headings:
1 |
gr_History.<span>SaveAs</span>("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 |
dw_equipmt.<span>SaveAs</span>("gr_computers", & |
1 |
<span></span> "G:INVENTORYSALES.XLS", Excel!, TRUE) |