I want save my HTML string into xlsx file and pdf.
For Xlsx i am using following code:
Response.AppendHeader("content-disposition", "attachment;filename=Data.xlsx");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.ms-excel";
Response.Write(htmldata);
Response.End();
if i am using follwing xls in place of xlsx it working fine, but i have to save the data in xlsx file.
For pdf i am using itextsharp library
https://www.aspsnippets.com/Articles/MVC-iTextSharp-Example-Convert-HTML-to-PDF-using-iTextSharp-in-ASPNet-MVC.aspx
file is not downloading.
Please help.