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.

What Spreadsheet is used in the examples?

Thread ID:

Created:

Updated:

Platform:

Replies:

130424 May 11,2017 07:26 PM May 12,2017 04:50 AM ASP.NET Core 1
loading
Tags: Spreadsheet
Zach Durtschi
Asked On May 11, 2017 07:26 PM

Hello,

I am trying to understand the code samples for the Spreadsheet function, but there is an important part that I don't understand. In the controllers, code such as Spreadsheet.Open() and Spreadsheet.Save() is used, for example:

public string Import(ImportRequest importRequest)
        {
            return Spreadsheet.Open(importRequest);
        }
However, when I try to use this code, it does not work, with a message that the Spreadsheet class from Syncfusion.XlsIO needs a generic type.
Am I supposed to get the Spreadsheet class from somewhere else? If not, is the example out of date or otherwise incorrect?

Silambarasan I [Syncfusion]
Replied On May 12, 2017 04:50 AM

Hi Zach, 
 
Thank you for using Syncfusion products. 
 
We have checked with the reported issue and we are unable to reproduce it in our end. We suspect that the cause of your issue might be the missing dependencies in your project. So, we would like to suggest you to ensure the packages ‘Syncfusion.EJ.AspNet.Core’ (Control core functionality) and ‘Syncfusion.EJ.Export’(Import Export functionality) are installed in your project.  After added it, please ensure the following code example. 
HOMECONTROLLER.CS 
using Syncfusion.JavaScript.Models; 
using Syncfusion.JavaScript; 
using Syncfusion.EJ.Export; 
 
//... 
 
public string Import(ImportRequest importRequest) 
{ 
    return Spreadsheet.Open(importRequest); 
} 
public ActionResult ExcelExport(string sheetModel, string sheetData, string password) 
{ 
    return Spreadsheet.Save(sheetModel, sheetData, "sample", ExportFormat.XLSX); 
} 
public ActionResult CsvExport(string sheetModel, string sheetData, string password) 
{ 
    return Spreadsheet.Save(sheetModel, sheetData, "sample", ExportFormat.CSV); 
} 
 
 
INDEX.CSHTML 
 
<ej-spread-sheet id="Spreadsheet"> 
    <e-scroll-settings height="560"></e-scroll-settings> 
    <e-import-settings import-mapper="Home/Import"></e-import-settings> 
    <e-export-settings excel-url="Home/ExcelExport" 
                        csv-url="Home/CsvExport" 
                        pdf-url="http://js.syncfusion.com/ejservices/api/Spreadsheet/PdfExport"></e-export-settings> 
</ej-spread-sheet> 
 
 
For your convenience, we have modified the provided sample in forum#130390 and the same can be downloaded from the below link, 
 
Also, please refer the below help documentation link for about Spreadsheet dependencies and nugget packages installation information. 
 
Regards, 
Silambarasan 


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.

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.

;