2

I've implemented this UX for ExtJs 4 (it generates an Excel file from an ExtJs 4 grid or store)

http://druckit.wordpress.com/2013/10/26/generate-an-excel-file-from-an-ext-js-4-grid/#comment-982

and it works perfectly in Chrome, however I keep getting this error " the data area passed to a system call is too small" in any version of IE

Here is the fragment of code that seems to be the problem, the full code is in the link above.

    var el = Ext.DomHelper.append(gridEl, {
        tag: "a",
        download: title + "-" + Ext.Date.format(new Date(), 'Y-m-d Hi') + '.xls',
        //download: 'descarga.xls',
        href: location
    });

    el.click();    //this line seems to be causing the error

    Ext.fly(el).destroy();   
}

I know there is downlodify and other options (like server side generating) but they are not an option at this point for me.

Is there any chance I can make this UX work in IE?

Can anyone point me in the right direction ?

Thank you.

code4jhon
  • 5,725
  • 9
  • 40
  • 60
  • 1
    Look here for a similar problem http://stackoverflow.com/questions/14839882/open-html-page-in-excel-via-javascript – Lorenz Meyer Nov 01 '13 at 14:03
  • Well I guess I 'll have to send my grid data to the server and try to just return it like "application/msexcel" if that doesn't work I'll have to actually use POI, thank you – code4jhon Nov 02 '13 at 20:22

1 Answers1

1

Using the listed method will not work well with IE because IE has a limit of 2083 characters. If you debug the code in this fiddle https://fiddle.sencha.com/#fiddle/17j you'll notice that the location variable is well over 5000 characters and also fails in IE. I'm assuming the issue is the same if you debug your code as well.

azeroth12
  • 449
  • 4
  • 3