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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Export to excell...

Thread ID:

Created:

Updated:

Platform:

Replies:

123300 Mar 5,2016 05:12 PM UTC Mar 7,2016 11:44 AM UTC ASP.NET MVC 1
loading
Tags: Grid
Mark Rye
Asked On March 5, 2016 05:12 PM UTC

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.

Jayaprakash Kamaraj [Syncfusion]
Replied On 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.

CONFIRMATION

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.

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

;