Exporting Dundas Charts to Aspose.Cells

Dundas charts are simply awesome. What I found problematic at first was having to save these charts to temporary files in order to export the image into another utility (Excel doc, PPT, doc, etc). I did a bit of digging and it is extremely simple to do so:

  1.            // save and add image to export

And thats it. You now have the image in the MemoryStream for use anywhere (to write to a file it you want as well). This prevents saving the document to the file system and having to worry about permissions for writing in IIS, meaning less to maintain.

In my particular scenario I was exporting the image into Aspose.Cells -> which is an Excel Export Utility assembly. Here is how that was accomplished:


All you have to do is essentially pass it the stream (in our case its MemoryStream). The rest of the code is Aspose.Cells specific API code.