ResetDataColors  SeriesCount

Chapter 10: Methods for Graphs in the DataWindow Control

SaveAs

Description

Saves the data in a graph in the format you specify.

Syntax

integer dwcontrol.SaveAs ( string graphcontrol {, string filename, SaveAsType saveastype, boolean colheading } )

Argument

Description

dwcontrol

A reference to the DataWindow control or DataStore containing the graph.

graphcontrol

A string whose value is the name of the graph in the DataWindow control or DataStore.

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 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, Excel5, and Text. For most other formats, column headings are always saved.

Returns

Returns 1 if it succeeds and -1 if an error occurs. If any argument’s value is NULL, SaveAs returns NULL.

Usage

If you do not specify any arguments, PocketBuilder 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, PocketBuilder displays the Save As dialog box, letting the user specify the format of the saved data.

Examples

Example 1

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)

See also





Copyright © 2004. Sybase Inc. All rights reserved. SeriesCount

View this book as PDF