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

Export to PDF group header problem

1 Answer 154 Views
Grid
This is a migrated thread and some comments may be shown as answers.
anshul
Top achievements
Rank 1
anshul asked on 02 Jun 2014, 12:04 PM
Hi,
I have a report in radgrid with grouping on basis of one field. The screen shot for the grid is attached. Now when i export the grid to PDF, group header column also gets exported leaving blank columns which are not required.
Also i cannot set the width of the headers when exporting to PDF. I have searched for may threads but of no help.
Any help would be appreciated.

Thanks
Anshul

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Jun 2014, 06:39 AM
Hi Anshul,

You can set the HideStructureColumns property of the ExportSettings to true to hide the Group column and you can set the width for columns on export as shown below.

ASPX:
<ExportSettings HideStructureColumns="true">
</ExportSettings>

C#:
bool isExport = false;
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
  if (e.CommandName == RadGrid.ExportToPdfCommandName)
  {
   isExport = true;    
  }
}
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
 if (isExport)
  {
    RadGrid1.MasterTableView.GetColumn("ColumnUniqueName").HeaderStyle.Width = Unit.Pixel(150);
  }
}

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