Generates a Flash movie, a JPEG image or a PNG image from a chart and returns the corresponding binary data.

object.ExportAsBinary

Arguments

object
Required. A Chart object.

Return Value

The ExportAsBinary method returns a binary value that contains the generated Flash movie, the JPEG image or the PNG image.

Remarks

This method is actually similar to the ExportAsResponse method. However, ExportAsBinary does not require the Response object provided by the web server. The method actually:

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

VBScript Sample Code

The following VBScript code illustrates use of the ExportAsBinary method in a ASP page.

'Create the chart series
Response.Expires= 0
Response.ContentType= "application/x-shockwave-flash"

Dim values_1(2)
Dim values_2(2)

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
bin_swf= chart.ExportAsBinary

'Once generated, we simply write it into the Response object
Response.BinaryWrite bin_swf

See Also

ExportAsFile Method | ExportAsResponse Method | SetOutputFormat Method

Applies To: Chart Object