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

Grid export PDF/EXCEL

3 Answers 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
balaji
Top achievements
Rank 1
balaji asked on 10 Jan 2011, 08:55 AM
Hi,

I'm working on export rad grid data to pdf/excel.

I have a custom filter for all the columns with dropdown,datetime and checkbox filter. while i export i dont want this filter template to populate either pdf/excel.(bcoz its putting 0(zero) instead of filter column). and i used Office2007 skin so i need to have same while export pdf.

Please help me on this and thanx in advance.

Balaji

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 10 Jan 2011, 11:43 AM
Hello Balaji,

If you want to hide filter item in exported file, try the following code snippet.

C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
   {
       if (e.CommandName == RadGrid.ExportToExcelCommandName)//when exporting to Excel
       {
             GridFilteringItem filterItem = (GridFilteringItem)RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0];
             filterItem.Visible = false;
             RadGrid1.ExportSettings.OpenInNewWindow = true;
       }
   }

Thanks,
Princy.
0
balaji
Top achievements
Rank 1
answered on 10 Jan 2011, 12:10 PM
thanx princy it worked charm... do u've any idea about apply skin (i.e office2007) /style for export PDF.
0
Princy
Top achievements
Rank 2
answered on 11 Jan 2011, 08:52 AM
Hello Balaji,


RadGrid do not export any external styles. That means that your skins will not appear in the generated file. Still, the inline styles are preserved and should be used instead.

The documentation describes more:
PDF export
Word/Excel export (HTML-based)


Thanks,
Princy.
Tags
Grid
Asked by
balaji
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
balaji
Top achievements
Rank 1
Share this question
or