1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    18
    Vote Rating
    0
    paritalak is on a distinguished road

      0  

    Default How to download all records from Datagrid to Excel file

    How to download all records from Datagrid to Excel file


    Hi

    I am trying to download all the records that are available in datagrid to Excel/CSV file.
    Problem for me was it is only exporting the records that are showing on the screen but not all the recordset.

    Also I was wondering if we apply filters on the data can we just download that dataset also?

    I would appreciate if any kind of help.

    Thanks
    Krishna

  2. #2
    Sencha User
    Join Date
    Jan 2010
    Posts
    254
    Vote Rating
    16
    existdissolve will become famous soon enough

      0  

    Default


    I know there are plugins that help a bit with some of the printing, but seriously, I think the best way is to let the server handle this.

    For me, I simply send back to the server the same request I made to get the records, but add an extra param for "switching" to excel mode. My server-side code will then process the query just as it normally would, but then it will create the excel file and push it for download.

    The reason I like this is because it is simple, and it allows me as much freedom as I want to manipulate the data server-side before creating the Excel.