We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Exporting a Chart to Excel, PDF or images

Hello,

There are several exporting capabilities for Chart under ASP, WinForms, MVC but nothing seems to exist for Silverlight.

Is there any possibility to simply export a Chart with Silverlight in the current version (8.23) and if not, will it be available in a forthcoming version ?

Thanks in advance for you answer
Best regards
Philippe Chessa


6 Replies

AR Abdul Rahman A.H Syncfusion Team October 12, 2010 12:41 PM UTC

Hi Philippe,

Thanks for your interest on Syncfusion products.

We do not have export support in Chart Silverlight. We will let you know once this feature is implemented in Chart Silverlight.

Regards,
Abdul Rahman





PC Philippe Chessa October 12, 2010 01:26 PM UTC

Hi Abdul,

That's depressing news.
We badly need this feature for our product...
Do you have any suggestion ? Saving the current page or canvas to image format (jpg, png) would be sufficient in a 1st version

Thanks in advance for your assistance

Best regards
Philippe



AP Anthony PALLINI October 13, 2010 11:55 AM UTC

Hello,

In our project, we had to do something like that,
You need other dll (We found it on internet)
Here is some code :
// LayoutRoot is the grid where chart is used.

JpegEncoder _iEncoder = new JpegEncoder();
int _iWdth = (int)ContentFrame.ActualWidth;
int _iHgth = (int)ContentFrame.ActualHeight+64;
WriteableBitmap _iWb = new WriteableBitmap(_iWdth, _iHgth);
_iWb.Render(LayoutRoot, new RotateTransform() { Angle = 0 });
_iWb.Invalidate();

SaveFileDialog _iSfd = new SaveFileDialog
{
Filter = "JPG Files (*.jpg)|*.jpg|All Files (*.*)|*.*",
DefaultExt = ".jpg",
FilterIndex = 1
};
if ((bool)_iSfd.ShowDialog())
{
using (Stream _iStream = _iSfd.OpenFile())
{
_iEncoder.Encode(_iWb.ToImage(), _iStream);
_iStream.Close();
}
}




ImageTools 0.2_3a4627a9.rar


AR Abdul Rahman A.H Syncfusion Team October 18, 2010 01:33 PM UTC

Hi,

Thanks for choosing Syncfusion products.

You can take a snapshot of our control using the WriteableBitmap class. But, Silverlight doesn't support to export the Image Source as a file stream in local system.


Please download the sample attached.


Let us know if you have any questions.


Thanks
Abdul Rahman




Snapshot_909929ee.zip


HC Hoang Cuong December 10, 2010 01:43 PM UTC

I strongly need this chart exporting function too. Why does not Syncfusion implement it in your internal code?



NK Nithin Kaushik A Syncfusion Team December 16, 2010 12:36 PM UTC

Hi Philippe,

Thanks for your interest in Syncfusion products.

Silverlight doesn't provide support for save Controls as a File Stream. But WPF can provide support to save objects by using XamlWriter.Save method. Microsoft does not provide this support in Silverlight.

Let us know if you have any questions.

Regards,
Nithin Kaushik


Loader.
Live Chat Icon For mobile
Up arrow icon