In this example we need a way to provide “image1.png” from the ASP.NET server. On the request for the page (test.aspx) we can create the report and send back the HTML, but we need to persist all images here, so when the browser asks for them we know how to get them.
We provide three operating modes for images so they can be sent to the browser, and they are controlled by the ImageExportMode property:
This is the simplest mode, and when using it, FlexCel will output all the images to a temporary folder when the browser asks for the page. The image links in the main HTML file will link to this folder, and so the browser will be able to get them when it needs them.
Images will be named with a GUID, so even if two different browsers ask for the same report at the same time, they will get different images.
When working in this mode you will need to implement a “Garbage collection” of images older than a given timespan, in order to avoid infinite grow of temporary images. You can do this with some scripts on the server, or use the ImageTimeout property in FlexCelAspViewer.
This mode is not actually suited for wide use, but can be used in controlled environments, where you can test that the browsers work fine. Not all the browsers will work in this mode. Older browsers might ask for the image twice, and will not get it the second time
On this mode, as in the first one, images will be saved to a temporary folder when the main page is requested by the browser. But, instead of links to the image, the generated HTML will contain links to HTTPHandlers, as shown below: