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

exportToExcel() - bit value

3 Answers 101 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Błażej
Top achievements
Rank 1
Błażej asked on 11 Oct 2011, 10:01 AM
Hi, I want to export my radgrid content to excel ,and I'm using function : ExportToExcel() ,
the problem is: I have some field which is type of bit. After export the place where should be bit value I see blank space. How can i repair it ?

and the 2nd question , how to set good size of column in excel (something like autoGrow).

regards

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Oct 2011, 12:09 PM
Hello Blazej,

Pleae try setting ExportOnlyData as true.

<ExportSettings ExportOnlyData="true">


You can set the Excel column width as follows.
C#:
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
   {
       if (e.CommandName == RadGrid.ExportToExcelCommandName)
       {
           RadGrid1.MasterTableView.GetColumn("name").HeaderStyle.Width = Unit.Pixel(20);
           RadGrid1.MasterTableView.ExportToExcel();
       }
   }
Also take a look into the following help documentation.
Word/Excel export (HTML-based)

Thanks,
Princy.
0
Błażej
Top achievements
Rank 1
answered on 11 Oct 2011, 12:38 PM
Hi,
I don't want to set width in radgrid, in radgrid everything is ok.(columns are growing when a lot of words), but in excel after export my columns have all the time the same width...
I want that width(of excel columns) will be set automatically.
0
Shinu
Top achievements
Rank 2
answered on 12 Oct 2011, 05:50 AM
Hello Blazej,

The following forum discussed the similar scenario.
How to fix column size after exporting to excel.

Thanks,
Shinu.
Tags
Grid
Asked by
Błażej
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Błażej
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or