Saves the chart as a Flash movie file (.swf), a JPEG image file (.jpg) or a PNG image file (.png).

object.ExportAsFile( filename )

Arguments

object
Required. A Chart object.
filename
Required. A string that specifies the name of the saved file.

Remarks

If the system fails to create or generate the output file, the ExportAsFile method raises an error.

The format of the generated file (i.e. Flash movie, JPEG image or PNG image) is defined by the method SetOutputFormat.

JScript Sample Code

The following JScript code illustrates use of the ExportAsFile method.

// Create the chart series
var values_1= new Array(3);
var values_2= new Array(3);

values_1[0] = 10;
values_1[1] = 20;
values_1[2] = 30;

values_2[0] = 100;
values_2[1] = 200;
values_2[2] = 300;

chart.AddSeries();
chart.SetSeriesValuesFromArray(0, values_1);

chart.AddSeries();
chart.SetSeriesValuesFromArray(1, values_2);

// Set the graphics settings from a style file
chart.LoadStyle("C:\\myStyle.scs");

// The chart is complete, we can now generate the movie
chart.ExportAsFile("C:\\myFlashMovie.swf");

See Also

ExportAsResponse Method | ExportAsBinary Method | SetOutputFormat Method

Applies To: Chart Object