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

Hide filter text in Excel report

2 Answers 201 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anon
Top achievements
Rank 1
Anon asked on 10 Mar 2011, 06:28 PM
I have an Excel button next to the RadGrid to export the grid data into Excel.
AllowFilteringByColumn is set to True for this RadGrid.

The generated Excel file is displaying a row with the filtered text.  Is there a way to hide this row?

The following line of code doesn't seem to hide the row.
radGrid.ExportSettings.ExportOnlyData = true;


Thank you.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Mar 2011, 05:32 AM
Hello Anon,

If you have set ExportOnlyData = true, then it will hide the filter row. If that is not working give a try with the following code snippet.

C#:
protected void ExportButton_Click(object sender, EventArgs e)
  {
      RadGrid1.ExportSettings.OpenInNewWindow = true;
      GridFilteringItem filterItem = (GridFilteringItem)RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)[0];
      filterItem.Visible = false;
      //RadGrid1.ExportSettings.ExportOnlyData = true;
      RadGrid1.MasterTableView.ExportToExcel(); 
  }

Thanks,
Princy.
0
Mihai
Top achievements
Rank 1
answered on 02 Apr 2011, 04:52 PM

The site Excel Reports, the #2 Excel website, has a great Excel tutorial. Highly recommended for people creating reports in Excel

Excel Reports
 http://www.excelreports.info/

Tags
Grid
Asked by
Anon
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Mihai
Top achievements
Rank 1
Share this question
or