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

Export to Excel has column widths too bid

2 Answers 24 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Paul Ridden
Top achievements
Rank 1
Veteran
Paul Ridden asked on 05 May 2010, 01:38 PM
Hi

I have a grid where the column widths are dictated by the content. When exported to Excel (ToExcelML) this writes the column widths being diplayed.

e.g.
<Table>
<Column ss:Width="1709" ...

If the width is greater about 1340 (e.g. 1350) Excel errors when it is opened. Is it possible to either prevent this my end or can you put a max value of 1300 if it is being displayed greater than that?

Thanks
Russell Mason

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 12 May 2010, 01:20 PM
Hi Russell,

Sorry for the late reply! Indeed this is very strange - I've just checked the HTML format and everything worked as expected. Most probably the issue is with ExcelML format in general and my suggestion is to set Width for grid columns explicitly just before exporting to avoid this.

All the best,
Vlad
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
simone bartoccioni
Top achievements
Rank 1
answered on 05 Apr 2011, 10:11 PM
I can confirm this issue

It happens with large monitors (I have a 23") and few columns on the grid.

But the workaround of Vlad work fine.

I use this code :

For Each cln As GridViewColumn In fdgv.Columns
    If cln.Width > 1300 Then
        cln.Width = 1300
    End If
Next

Ciao
Simone
Tags
GridView
Asked by
Paul Ridden
Top achievements
Rank 1
Veteran
Answers by
Vlad
Telerik team
simone bartoccioni
Top achievements
Rank 1
Share this question
or