Article ID: 264096 - Last Review: August 23, 2005 - Revision: 3.3 FILE: ChartGIF.exe Demonstrates Streaming an Office Web Chart GIF to the BrowserThis article was previously published under Q264096 SUMMARY
ChartGIF.exe is a sample file that illustrates how you can use server-side script with the Office 2000 and Office XP Web Chart Components to send a GIF representation of a chart as binary data to your client's browser. The advantage of the technique that ChartGIF.exe demonstrates is that you do not need to rely on session management for deleting temporary chart GIF files on the server. Instead, temporary chart GIF files are streamed to clients as binary data and are immediately deleted.
MORE INFORMATIONThe following file is available for download from the Microsoft Download Center: ChartGIF.exe
(http://download.microsoft.com/download/excel2000/sample/2000/w9x2k/en-us/chartgif.exe)
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591
(http://support.microsoft.com/kb/119591/EN-US/
)
How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
How the Sample WorksASP script generates a chart with the Office Web Component in memory (that is, Server.CreateObject("OWC.Chart").) When the chart contains all of the desired series and formatting, the ASP script calls the ExportPicture method of the ChartSpace to generate a temporary GIF representation of the chart. This GIF is then streamed to the client as binary data with Response.BinaryWrite.BinaryWrite requires a single argument that is a variant array of unsigned one-byte characters. By using an ActiveX DLL developed with Microsoft Visual Basic, the ASP script can retrieve this array of bytes from the temporary GIF file and then pass the byte array as the argument to BinaryWrite. BinaryWrite streams the data to the client and the temporary GIF file is deleted. Please see the "References" section of this article for more information on this topic. How to Use the Sample Files
Problems with Server-Side UseYou should be aware that the Office 2000 Web Components are not designed for server-side use, and you may encounter problems if you use the components on a server with a high number of concurrent user connections. Many of these issue are addressed in the Office XP Web Components, and you should consider using the Office XP Web Components for large-scale server-side solutions.For additional information, click the article number below to view the article in the Microsoft Knowledge Base: 317316
(http://support.microsoft.com/kb/317316/EN-US/
)
INFO: Limitations of Office 2000 Web Components When Used Server-Side
REFERENCESProgramming Microsoft Office 2000 Web Components by Dave Stearns, ISBN 0-7356-0794-X
http://support.microsoft.com/ofd
(http://support.microsoft.com/ofd)
For more information about reading and displaying binary data with ASP, see the following Knowledge Base articles:
193998
(http://support.microsoft.com/kb/193998/EN-US/
)
HOWTO: Read and Display Binary Data in ASP
For more information, see the following Knowledge Base articles:
258187
(http://support.microsoft.com/kb/258187/EN-US/
)
OWebComp.exe Contains Scripting Samples for the Office Web Components
244049
(http://support.microsoft.com/kb/244049/EN-US/
)
HOWTO: Use Server-Side Charting to Generate Charts Dynamically
(c) Microsoft Corporation 2000, All Rights Reserved. Contributions by Dave Stearns, Microsoft Corporation.
| Article Translations
|
Back to the top
