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.
Unfortunately, activation email could not send to your email. Please try again.

Exporting a Chart to Excel, PDF or images

Thread ID:

Created:

Updated:

Platform:

Replies:

96818 Oct 7,2010 11:05 AM Dec 16,2010 07:36 AM Silverlight 6
loading
Tags: Chart
Philippe Chessa
Asked On October 7, 2010 11:05 AM

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


Abdul Rahman A.H [Syncfusion]
Replied On October 12, 2010 08:41 AM

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




Philippe Chessa
Replied On October 12, 2010 09:26 AM

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


Anthony PALLINI
Replied On October 13, 2010 07:55 AM

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

Abdul Rahman A.H [Syncfusion]
Replied On October 18, 2010 09:33 AM

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

Hoang Cuong
Replied On December 10, 2010 08:43 AM

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


Nithin Kaushik A [Syncfusion]
Replied On December 16, 2010 07:36 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;