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

Custom Cell in Export with Grid mvc kendo

1 Answer 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Houssem
Top achievements
Rank 1
Houssem asked on 21 Oct 2015, 01:21 PM

Hello,

 I need to format some cell in export excell with kendo mvc grid. I use the export in this way :

.Index.cshtml :

 .ToolBar(tools => tools.Excel())
.Excel(excel => excel
.FileName("Export.xlsx")
.ForceProxy(true)
.Filterable(true)
.AllPages(true)
.ProxyURL(Url.Action("ExcelSave", "CieAssistant"))
)

 Controller :

public ActionResult ExcelSave(string contentType, string base64, string fileName)
{
var fileContents = Convert.FromBase64String(base64);
return File(fileContents, contentType, fileName);
}

 

How i can update format of cell in the controller function "ExcelSave" ?!

 

Thanks,

1 Answer, 1 is accepted

Sort by
0
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 21 Oct 2015, 09:07 PM
Hello Houssem,

Take a look at the attached project illustrating how to format cells when exporting to Excel.

Here is the process of how the program runs:
1. Hit the Export button.
2. The formatting will occur with the function excelExport() before any exporting takes place.  
3. The file is created.

Hopefully, this helps clear things.

Regards,
Pat
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Houssem
Top achievements
Rank 1
Answers by
Patrick | Technical Support Engineer, Senior
Telerik team
Share this question
or