Hi all,
I'm exporting the excel of radgrid.
My excel format is ExcelML.
I want to add title on head of the excel. In Html format Im getting title by setting the caption of mastertableview of grid
But I dont know why its not coming for ExcelML format and how to add.
Please help me in this.
My code..
Radgrid.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML;
Please provide me the code.
I dont have download access.
I'm exporting the excel of radgrid.
My excel format is ExcelML.
I want to add title on head of the excel. In Html format Im getting title by setting the caption of mastertableview of grid
But I dont know why its not coming for ExcelML format and how to add.
Please help me in this.
My code..
Radgrid.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML;
Please provide me the code.
I dont have download access.
5 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 18 Nov 2011, 08:21 AM
Hello Ram,
Try the following code snippet.
C#:
-Shinu.
Try the following code snippet.
C#:
protected
void
RadGrid1_ExcelMLExportRowCreated(
object
sender, Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowCreatedArgs e)
{
if
(e.RowType == Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowType.HeaderRow)
{
e.Worksheet.WorksheetOptions.PageSetup.PageHeaderElement.Data =
"Your Text"
;
}
}
-Shinu.
0

Ram
Top achievements
Rank 1
answered on 21 Nov 2011, 01:19 PM
Hi
Thanks for reply but It didn't work for me.
Thanks for reply but It didn't work for me.
0
Hello Ram,
The code Shinu posted adds the specified text in the Page Header Element which can be seen when printing or when viewing the Page Layout in Excel.
If you want it to be visible on initial opening, you can add a dummy row with the desired text when exporting.
I hope this helps.
Kind regards,
Mira
the Telerik team
The code Shinu posted adds the specified text in the Page Header Element which can be seen when printing or when viewing the Page Layout in Excel.
If you want it to be visible on initial opening, you can add a dummy row with the desired text when exporting.
I hope this helps.
Kind regards,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0

Mohamed Salah Al-Din
Top achievements
Rank 1
answered on 18 Dec 2011, 07:10 PM
Dear Mira ,
How I can add this dummy row while exporting?
Best Regards,
Mohamed Salah Al-Din
How I can add this dummy row while exporting?
Best Regards,
Mohamed Salah Al-Din
0

Shinu
Top achievements
Rank 2
answered on 19 Dec 2011, 05:37 AM
Hello Mohamed,
Try the following code.
C#:
-Shinu.
Try the following code.
C#:
protected
void
RadGrid1_GridExporting(
object
sender, GridExportingArgs e)
{
e.ExportOutput = e.ExportOutput.Replace(
"</body>"
,
"<div style=\"color:Red;\">Your text</div></body>"
);
}
-Shinu.