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. Image for the cookie policy date

Export to excell...

We are trying to follow the example on how to export data to excel.  We have the grid on the page and it is attempting to hit the Export to excel endpoint.

on the controller we have imported the following


using Syncfusion.EJ;

using Syncfusion.EJ.Export;

using Syncfusion.Linq;

using Syncfusion.Compression;

using Syncfusion.DocIO;

using Syncfusion.XlsIO;

using Syncfusion.Pdf;


the controller is as so...

My problem is that intellisence is not recognizing the GridProperties or the ExcelVersion. as best I can tell I have included the needed dependencies.  or is there a better way to accomplish this?

Thanks.

1 Reply

JK Jayaprakash Kamaraj Syncfusion Team March 7, 2016 11:44 AM UTC

Hi Mark,

Query1: My problem is that intellisence is not recognizing the GridProperties

We suggest you to refer Syncfusion.JavaScript.Models to recognize the GridProperties. Please refer to the following code example and sample.  

Code Example:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

using SyncfusionMvcApplication50;

using Syncfusion.EJ.Export;

using Syncfusion.JavaScript.Models;

using Syncfusion.XlsIO;

using System.Web.Script.Serialization;

using System.Collections;

using System.Reflection;

namespace SyncfusionMvcApplication50.Controllers

{

    public class GridController : Controller

    {

        //

        // GET: /Grid/

        public ActionResult GridFeatures()

        {

            var DataSource = new NorthwindDataContext().OrdersViews.ToList();

            ViewBag.datasource = DataSource;

            return View();

        }

        public void ExportToExcel(string GridModel)

        {

            ExcelExport exp = new ExcelExport();

            var DataSource = new NorthwindDataContext().OrdersViews.ToList();

            GridProperties obj = ConvertGridObject(GridModel);

            exp.Export(obj, DataSource, "Export.xlsx", ExcelVersion.Excel2010, false, false, "flat-saffron");
        }


Sample: http://www.syncfusion.com/downloads/support/forum/123300/ze/SyncfusionMvcApplication50-1023188729

Query 2: My problem is that intellisence is not recognizing the ExcelVersion

We suspect that you are not referring Dependent assemblies in the same version according to the .NET Framework. Please refer to the following table and refer the corresponding DLL’s in your project.

MVC Versions

MVC DLL Version

Base DLL Version

Supported Frameworks

MVC 3

13.4300.0.53

12.4400.0.53

v4.0, v4.5, v4.5.1

MVC 4

13.4400.0.53

13.4400.0.53

v4.0, v4.5, v4.5.1

MVC 5

13.4500.0.53

13.4450.0.53

v4.5, v4.5.1

MVC 5

13.4500.0.53

13.4451.0.53

v4.5.1


Regards,

Jayaprakash K.

Loader.
Live Chat Icon For mobile
Up arrow icon