How to use 'AllowSheetOnDemand'?

Hi,

When I set the "AllowSheetOnDemand" to true, the first sheet is loading properly. But when I switch sheets, I get the below error:

ej.web.all.min.js:10
Uncaught TypeError: Cannot read property 'sheets' of undefined
    at Object.loadFromJSON (ej.web.all.min.js:10)
    at Object._importSuccess (ej.web.all.min.js:10)
    at Object.success (ej.web.all.min.js:10)
    at fire (jquery-1.10.2.js:3062)
    at Object.fireWith [as resolveWith] (jquery-1.10.2.js:3174)
    at done (jquery-1.10.2.js:8249)
    at XMLHttpRequest.callback (jquery-1.10.2.js:8792)


Below is my code. Can you please help me fix it as it is critical for my needs and I am looking to load spreadsheets with more than 1000 sheets and loading sheets on demand is a key for performance.

C#:

        [HttpPost]
        public ActionResult Import(ImportRequest importRequest)
        {
            importRequest.Url = new Uri(Request.Url, Url.Content("~/Excel/Sample.xlsx")).ToString();
            importRequest.AllowSheetOnDemand = true;
            return importRequest.SpreadsheetActions();
        }

CSHTML:

@(
        Html.EJ().Spreadsheet<object>("Spreadsheet")
        .AllowImport(true)
        .ImportSettings(import =>
        {
            import.ImportOnLoad(true).ImportMapper(Url.Action("Import", "Home")).AllowSheetOnDemand(true);
        })
        .ScrollSettings(scroll =>
        {
            scroll
            .AllowScrolling(true)
            .ScrollMode(SpreadsheetScrollMode.Infinite)
            .IsResponsive(true)
            .Height(640);
        })
        .AllowCharts(false)
        .AllowDataValidation(true)
        .ShowRibbon(false)
)

1 Reply

SK Shanmugaraja K Syncfusion Team September 18, 2018 04:01 PM UTC

Hi Arul, 
 
Thank you for using Syncfusion products. 
 
We request you to follow the incident which is created by you for the same query under your direct trac account for further assistance.  
 
 
Regards, 
Shanmugaraja K 
 


Loader.
Up arrow icon