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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Export Data without using grid

Thread ID:

Created:

Updated:

Platform:

Replies:

109321 Jun 6,2013 07:57 PM UTC Jun 10,2013 12:32 PM UTC ASP.NET MVC (Classic) 1
loading
Tags: Grid
Dimitrios Vrakas
Asked On June 6, 2013 07:57 PM UTC

Can i use the export to excel feature without using the grid control.

I notice the grid will perform a POST. with json information. Can I simply call ExportToExcel action and have the data converted to excel using a static grid method or some sort of technique . I don't need to display the data in the grid to the user,  but i would like to return a formatted excel sheet of a dataset. 

Ajith R [Syncfusion]
Replied On June 10, 2013 12:32 PM UTC

Hi Dimitrios,

                Thanks for using Syncfusion products.

                 We would like to you know that  exporting data without grid  is not possible, as we do internal operation  for exporting  data from grid to excel using Mapping method. So we suggest you to  generate the grid without rendering data and exporting to excel by use the following code snippet.               

            Generating grid without rendering:

public ActionResult Index()

        {

            var data = new MyClassContext().myclass.ToList();

            return View();

        }

        Export to Excel:

        [AcceptVerbs(HttpVerbs.Post)]

        public ActionResult Export(PagingParams args)

        {

            var data = new MyClassContext().myclass.ToList();

            return data.GridExportToExcel<MyClass>("GridExcel.xlsx", ExcelVersion.Excel2007);

        }      

 

       Please refer to the following link to download the sample.                    

            Please get back us if you have any other concerns.               

Regards

Ajith R

 



ExcelExport_1d6c924d.zip

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

;