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

GridView Excel export issue

1 Answer 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Florent
Top achievements
Rank 1
Florent asked on 20 Nov 2017, 09:16 AM

Hi,

I manage to export a GridView into an Excel file (.xlsx).

But when I am trying to insert an excel graphic with the exported data, all the predefined styles are empty

If I start from a blank new excel file, typing values and inserting a graphic, it is ok

Please look attachments to see what I mean.

Is it an Excel template issue ?

My code looks like :

Dim dialog = New SaveFileDialog() With {
                 .DefaultExt = "xlsx",
                 .Filter = [String].Format("(*.{0})|*.{1}", "xlsx", "xlsx")
            }
dialog.ShowDialog()
 
Dim exportOptions = New GridViewDocumentExportOptions() With {
                           .AutoFitColumnsWidth = True,
                           .ExportDefaultStyles = False,
                            .ShowColumnFooters = grid.ShowColumnFooters,
                            .ShowColumnHeaders = grid.ShowColumnHeaders,
                            .ShowGroupFooters = grid.ShowGroupFooters
                          }
 
Using stream = dialog.OpenFile()
                    grid.ExportToXlsx(stream, exportOptions)
End Using

 

Regards

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 23 Nov 2017, 08:49 AM
Hello Florent,

The issue you've described seems to be related to this bug report we have logged in our feedback portal.

As I'm unable to reproduce it with Excel 2016, could you please try applying the workaround suggested in the feedback item (manually change the theme for the document) and let me know how it goes?

I look forward to your reply.

Regards,
Dilyan Traykov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Florent
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or