ExportToXps Multiple charts to the one stream

6 posts, 0 answers
  1. Nick Wood
    Nick Wood avatar
    126 posts
    Member since:
    Feb 2010

    Posted 17 Mar 2010 Link to this post

    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?
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 19 Mar 2010 Link to this post

    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.
  3. Shahinaz ElSayyad
    Shahinaz ElSayyad avatar
    3 posts
    Member since:
    Apr 2010

    Posted 19 Apr 2010 Link to this post

    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

  4. Nick Wood
    Nick Wood avatar
    126 posts
    Member since:
    Feb 2010

    Posted 19 Apr 2010 Link to this post

    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.
  5. Shahinaz ElSayyad
    Shahinaz ElSayyad avatar
    3 posts
    Member since:
    Apr 2010

    Posted 20 Apr 2010 Link to this post

    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
     

  6. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 20 Apr 2010 Link to this post

    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.
Back to Top