This is a migrated thread and some comments may be shown as answers.

ExportToXps Multiple charts to the one stream

5 Answers 52 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Nick Wood
Top achievements
Rank 1
Nick Wood asked on 17 Mar 2010, 06:54 AM
Hi All

I want to export several charts to an xps doc.

I tried the following:

private void Button_Click(object sender, RoutedEventArgs e) 
        { 
            SaveFileDialog dialog = PrepareSaveDialog(); 
 
            if (!(bool)dialog.ShowDialog()) 
                return
 
            Stream fileStream = dialog.OpenFile(); 
            this.ExportTheFile(fileStream); 
 
            fileStream.Close(); 
        } 
 
        private void ExportTheFile(Stream fileStream) 
        { 
            this.RadChartColdSetStartSpoils.ExportToXps(fileStream); 
            this.RadChartHeatSetStartSpoils.ExportToXps(fileStream); 
            this.RadChartComboStartSpoils.ExportToXps(fileStream); 
            this.RadChartAverageStartSpoils.ExportToXps(fileStream); 
        } 
 
        private SaveFileDialog PrepareSaveDialog() 
        { 
            SaveFileDialog dialog = new SaveFileDialog(); 
            dialog.DefaultExt = "xps"
            dialog.Filter = this.GetDefaulExt(); 
            return dialog; 
        } 
 
        private string GetDefaulExt() 
        { 
            return string.Format("*.{0} | {1} File""xps""xps"); 
        } 

It throws and error here: this.RadChartHeatSetStartSpoils.ExportToXps(fileStream); as the filestream is closed by the first call to ExportToXPS.

This method should not be closing the stream?. Is there any way to exports several charts to the one xps doc?

5 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 19 Mar 2010, 01:45 PM
Hello Nick,

Unfortunately the current version of the control does not support exporting multiple charts to a single XPS document. We will log your feature request in our public issue tracking system and we will forward it to our developers for further consideration.


Best wishes,
Freddie
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Shahinaz ElSayyad
Top achievements
Rank 1
answered on 19 Apr 2010, 05:08 PM
Hello Nick,
I have the same problem that you have, so I want to know if you found a solution to Export  several charts to an document?
Any ideas to how we can do that?
If you have a solution please tell me because I am in this problem from three days.


Thank You

0
Nick Wood
Top achievements
Rank 1
answered on 19 Apr 2010, 11:37 PM
In the end, we updated to silverlight 4 and used the RichTextBox control along with PrintDocument to push the charts out to the printer and its working really well. Its not an image now, so it scales to all printer sizes and orientations perfectly.
0
Shahinaz ElSayyad
Top achievements
Rank 1
answered on 20 Apr 2010, 08:51 AM

But I want to know how I can Export several charts to one Excel file, do you know how can I do that?
When I try to Export several charts, it through Exception because the filestream is closed by the first call to ExportToExcelM as u know.
And if you have a simple code to do that, this will be great.

Thank you
 

0
Giuseppe
Telerik team
answered on 20 Apr 2010, 01:39 PM
Hello Shahinaz ElSayyad,

The built-in exporting functionality in the current version of the control does not support exporting multiple charts to a single XPS / Excel document. This feature request is logged in our public issue tracking system and will be considered for one of the next versions of RadChart.


Greetings,
Freddie
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Chart
Asked by
Nick Wood
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Shahinaz ElSayyad
Top achievements
Rank 1
Nick Wood
Top achievements
Rank 1
Share this question
or