Export to Excel mvc razor sample code

Posted by: vivek12072005 on 31 July 2018, 10:05 pm EST

    • Post Options:
    • Link

    Posted 31 July 2018, 10:05 pm EST

    hello

    Please provide a sample for how to export to excel

    as i am not able to achieve this using razor pages. ExporttoPDF working fine

    Thanks

    Vivek Gupta

  • Posted 1 August 2018, 11:59 pm EST

    Hi Vivek,

    I am working on a sample application for you, will provide you soon.

    Thanks,

    Deepak Sharma

  • Posted 2 August 2018, 5:59 pm EST

    Hello,

    You can use the following ActionResult() method in your controller to Export Excel to response:

    
     public ActionResult Index([MvcSpread(true)]FarPoint.Mvc.Spread.FpSpread FpSpread1, FormCollection formCollection)
            {
                return FpSpread1.SaveExcelToResponse("Test.xls", FarPoint.Excel.ExcelSaveFlags.SaveAsViewed);
            }
    

    Please refer to the attached sample application.

    Thanks,

    Deepak Sharma

    SpreadMVCExcelExportTest.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels