Hi, I have a form that can display up to 4 charts in various layouts, and I want to be able to print the charts in the desired layout on a single page. Is there a way to do this?
Thanks.
Brian
I managed to figure out how to do this myself, although I'm not sure if it's the best way.
I rooted around the forum and found that you can save the chart to a stream as a bitmap of any size you like using the SaveTo() method. So I now create a bitmap big enough for all the charts on the form, and get a graphics object for it. I then save each chart in turn to a memory stream as a bitmap of the size I want on the final page, and then I reload it into a bitmap object, which I then draw to the appropriate part of the main bitmap using the DrawImage() method of the graphics object. Finally I can just print the resulting bitmap. :)
another way to do this would be to use the RenderPdfFriendlyGraphics method in conjunction with the Infragistics.Documents library. that library has a rich API for composing and printing a PDF.
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Win_Export_Charts_to_PDF_XPS_Whats_New_20073.html