Export PDF & Excel

2 posts, 0 answers
  1. David Gunderson
    David Gunderson avatar
    13 posts
    Member since:
    Apr 2010

    Posted 31 May 2011 Link to this post

    2 Issues,
    1. When I export to a pdf file it does not center the text of my columns under their headings, they are off a bit.  They are centered in the grid but not in the PDf Export.

    2. When exporting to a Excel file, there seems to be 3 buttons that export along with the header that they are in, i am assuming its the export buttons I turned on, is there a way to shut this off and only export the actuall data in grid.

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 01 Jun 2011 Link to this post

    Hello David,

    One suggestion is to align the text in ItemDataBound event and it will reflect when you are exporting to pdf. The following documentation explains more about this.
    PDF export.

    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
            if (e.Item is GridDataItem)
                GridDataItem item = (GridDataItem)e.Item;
                TableCell cell = item["ColumnUniqueName"];
                cell.Style.Add("text-align", "center");

    In order to hide buttons when exporting to excel set ExportOnlyData as true. Hope this helps you.

Back to Top