We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Unrecognized SaveAsActionResult method.

Thread ID:





125064 Jul 19,2016 08:56 AM UTC Jul 20,2016 08:56 AM UTC ASP.NET MVC 1
Tags: XlsIO
Asked On July 19, 2016 08:56 AM UTC


I'm trying to use the following code snippet provided as sample to write data on Excel file.

        public ActionResult GenerateXLS(string SaveOption)
            if (SaveOption == null)
                return View();

            //New instance of XlsIO is created.[Equivalent to launching Microsoft Excel with no workbooks open].
            //The instantiation process consists of two steps.

            //Step 1 : Instantiate the spreadsheet creation engine.
            ExcelEngine excelEngine = new ExcelEngine();
            //Step 2 : Instantiate the excel application object.
            IApplication application = excelEngine.Excel;

            //A new workbook is created.[Equivalent to creating a new workbook in Microsoft Excel]
            //The new workbook will have 12 worksheets
            IWorkbook workbook = application.Workbooks.Open(DefaultResolveApplicationDataPath(@"QuotePreview.xls"));

            IWorksheet sheet = workbook.Worksheets[1];
            sheet.FirstVisibleRow = 3;

            IFont font = workbook.CreateFont();
            font.Bold = true;


                //Saving the workbook to disk.
                if (SaveOption == "Xls")
                    //Save as .xls format
                    return excelEngine.SaveAsActionResult(workbook, "Quote1.xls", HttpContext.ApplicationInstance.Response, ExcelDownloadType.PromptDialog, ExcelHttpContentType.Excel97);
                //Save as .xlsx format
                    workbook.Version = ExcelVersion.Excel2013;
                    return excelEngine.SaveAsActionResult(workbook, "Quote1.xlsx", HttpContext.ApplicationInstance.Response, ExcelDownloadType.PromptDialog, ExcelHttpContentType.Excel2013);
            catch (Exception)

            //Close the workbook.
            return View();

        private string DefaultResolveApplicationDataPath(string fileName)
            //string dataPath = string.Format("{0}\\Common\\Data\\XlsIO\\", Request.PhysicalPath.ToLower().Split(new string[] { "\\XlsIO" }, StringSplitOptions.None));
            //return string.Format("{0}\\{1}", dataPath, fileName);

            string folderName = "Data\\XlsIO";
            string dataPath = new System.IO.DirectoryInfo(Request.PhysicalPath + "..\\..\\..\\..\\..\\Common").FullName;
            if (folderName != string.Empty)
                dataPath += "\\" + folderName;
            return string.Format("{0}\\{1}", dataPath, fileName);

When I compile, I get the error message Unable to find method SaveAsActionResult for ExcelEngine object.
Must I define an extension as explained in http://help.syncfusion.com/file-formats/xlsio/asp-net-mvc?

Can you help me?


Sridhar Sukumar [Syncfusion]
Replied On July 20, 2016 08:56 AM UTC

Hi Claudio, 
Thank you for contacting Syncfusion support. 
When I compile, I get the error message Unable to find method SaveAsActionResult for ExcelEngine object. 
Must I define an extension as explained in http://help.syncfusion.com/file-formats/xlsio/asp-net-mvc? 
Yes, you need to define an extension. 
We have prepared a simple sample for using XlsIO in ASP.NET MVC application which can be downloaded from the following link 
Alternative way: 
If you install Nuget package for ASP.NET MVC, then you no need to define the extension for those methods. The Nuget package for ASP.NET MVC can be downloaded from the following link: 
Download link: 
Sridhar S 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon