Extract chart from telerik web spreadsheet

1 Answer 70 Views
Chart Spreadsheet
Pablo
Top achievements
Rank 1
Pablo asked on 19 Oct 2022, 01:41 AM | edited on 19 Oct 2022, 01:46 AM

Hello, I would like to know if there is any way to extract the graphs from an excel sheet.  I have managed to export the content of the excel sheet but I have not been able to export the graph that is generated there

So far this is the code I handle

 


 byte[] bytes = System.IO.File.ReadAllBytes(@"path");
                Stream stream2 = new MemoryStream(bytes);

                Workbook workbook = Workbook.Load(stream2, ".xlsx");


                Telerik.Windows.Documents.Spreadsheet.Model.Workbook document = workbook.ToDocument();

                document.ActiveSheet = document.Worksheets.First(sheet => sheet.Name == "Rep.F3");
                foreach (Telerik.Windows.Documents.Spreadsheet.Model.Worksheet sheet in document.Worksheets)
                {

                    if (sheet.Name != "Rep.F3")
                    {
                        sheet.Visibility = Telerik.Windows.Documents.Spreadsheet.Model.SheetVisibility.Hidden;
                        //document.Worksheets.Remove(sheet);
                    }
                    else
                    {
                        var shapes = sheet.Shapes;
                        var img= sheet.Images;
                        sheet.WorksheetPageSetup.PaperType = Telerik.Windows.Documents.Model.PaperTypes.A4;
                        sheet.WorksheetPageSetup.PageOrientation = Telerik.Windows.Documents.Model.PageOrientation.Portrait;
                        sheet.WorksheetPageSetup.CenterHorizontally = true;
                        sheet.WorksheetPageSetup.PrintOptions.PrintGridlines = false;
                        sheet.WorksheetPageSetup.ScaleFactor = new Telerik.Documents.Primitives.Size(0.9, 1);
                        sheet.WorksheetPageSetup.Margins =
                            new Telerik.Windows.Documents.Spreadsheet.Model.Printing.PageMargins(0
                            , 20, 0, 0);
                    }

                }

 

I have tried to get the list of images and forms but it does not return any result

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 21 Oct 2022, 12:47 PM

Hello Pablo,

Based on the provided information I understand that the requirement at hand is to import/export charts from MS Excel to the Telerik UI Spreadsheet. Unfortunately, this functionality is not currently supported by the Spreadsheet.

That being said there is a Feature Request logged in our Feedback Portal here. I have taken the liberty to vote for it on your behalf because we determine what features to implement next based on community interest (measured in votes).

Please don't hesitate to let me know, if I've misunderstood the requirement at hand or if you'd like to share any additional feedback. Thank you.

Regards,
Stoyan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Chart Spreadsheet
Asked by
Pablo
Top achievements
Rank 1
Answers by
Stoyan
Telerik team
Share this question
or