3 Answers, 1 is accepted

protected void RadGrid1_GridExporting(object source, GridExportingArgs e)    {        string customHTML = "<div width=\"100%\" style=\"text-align:center;font-size:12px;font-family:Verdana;\">Custom Report</div>";               e.ExportOutput = e.ExportOutput.Replace("<body>", String.Format("<body>{0}", customHTML));    }Thanks,
Jayesh Goyani

but it does not work with PDF
my code:
protected
void RadGrid1_GridExporting(object source, GridExportingArgs e)
{
#region
Grab Info from DB
string sql = "SELECT [GridNo],[ReportName],[Other],[GenerateBy] FROM [GridHeader] where Gid='1'";
SqlDataReader dr = DataAccess.ExecuteReader(CommandType.Text, sql, null);
if (dr.Read())
{
ReportName = dr.GetString(dr.GetOrdinal(
"ReportName"));
Other = dr.GetString(dr.GetOrdinal(
"Other"));
GenerateBy = dr.GetBoolean(dr.GetOrdinal(
"GenerateBy"));
}
#endregion
string customHTML = "<div width=\"100%\" style=\"text-align:center;font-size:8px;font-family:Tahoma;\">" +
" <table width='100%'border='0'>" +
"<tr><td colspan='7' style=\"text-align:left;font-size:12px;font-family:Tahoma;\" ><b>Company Name :</b>" + Session["CompanyName"].ToString() + "</td></tr> " +
"<tr><td colspan='7' style=\"text-align:left;font-size:12px;font-family:Tahoma;\" ><b>Report Name:</b>" + ReportName + "</td></tr> "+
"<tr><td colspan='7' style=\"text-align:left;font-size:12px;font-family:Tahoma;\" ><b>Date:</b>" + DateTime.Now.ToString("d",CultureInfo.CreateSpecificCulture("en-NZ")) +"</td></tr> ";
if (Other != "")
{
customHTML1 =
"<tr><td colspan='7' style=\"text-align:left;font-size:12px;font-family:Tahoma;\" ><b>Note :</b>" + Other + "</td></tr> ";
}
else
{
customHTML1 =
"";
}
if (GenerateBy)
{
customHTML2 =
"<tr><td colspan='7' style=\"text-align:left;font-size:12px;font-family:Tahoma;\" ><b>Generated By :</b>" + Session["Emp_Name"].ToString() + "</td></tr> ";
}
else
{
customHTML2 =
"";
}
customHTML3 =
"</table>"+
"</div>";
e.ExportOutput = e.ExportOutput.Replace(
"<body>", String.Format("<body>{0}", customHTML + customHTML1 + customHTML2+customHTML3));
}
Please help me in Exporting PDF.

When exporting HTML tables, the table should define <colgroup> and <col> elements. Check the following help documentation which explains more about this.
PDF export
-Shinu.