Results 1 to 9 of 9

Thread: Export grid data to Excel/Csv

  1. #1
    Sencha User
    Join Date
    Jun 2014
    Posts
    82
    Answers
    1

    Default Export grid data to Excel/Csv

    Can you please give the example for Export grid data to Excel/CSV?

    Thanks and Regards,
    Ganesh. R

  2. #2
    Sencha User
    Join Date
    Jun 2014
    Posts
    82
    Answers
    1

    Default

    Hi,

    I am getting error like "Object does not support error".

    Can you please help me on this.

    I am using extjs 6.2.1 version and sencha architect 4.1.2.
    Browser is IE 9 & IE 10


    Thanks and Regards,
    Ganesh. R

  3. #3
    Sencha Premium User
    Join Date
    May 2016
    Posts
    20

    Default

    1. Make sure you have your gridexporter plugin in your grid. It's available for drag and drop in Architect
    Code:
    plugins: [
            {
                ptype: 'gridexporter'
            }
        ]
    2. To export

    Code:
    grid.saveDocumentAs({
         type: 'xlsx',
         title: 'List of Users',
         fileName: 'List_of_Users.xlsx'
    });

  4. #4
    Sencha User
    Join Date
    Jun 2014
    Posts
    82
    Answers
    1

    Default

    Quote Originally Posted by ma.l View Post
    1. Make sure you have your gridexporter plugin in your grid. It's available for drag and drop in Architect
    Code:
    plugins: [
            {
                ptype: 'gridexporter'
            }
        ]
    2. To export

    Code:
    
    
    grid.saveDocumentAs({
         type: 'xlsx',
         title: 'List of Users',
         fileName: 'List_of_Users.xlsx'
    });






    Hi,

    Thanks for your reply.
    But if I drag and drop grid exporter plugin in my grid panel it seems

    C is a not a constructor

    CSVFormatter.js
    ExcelFormatter.js

    Seems 404 not found error

    Anyone please help me on this.

    Thanks and Regards,
    Ganesh. R

  5. #5
    Sencha Premium User
    Join Date
    May 2016
    Posts
    20

    Default

    Can you post up your entire grid code including the listener which you are exporting the grid since I'm not sure how I can imitate your error.

  6. #6
    Sencha User
    Join Date
    Jun 2014
    Posts
    82
    Answers
    1

    Default

    Quote Originally Posted by ma.l View Post
    Can you post up your entire grid code including the listener which you are exporting the grid since I'm not sure how I can imitate your error.

    Hi,

    Thanks for your reply.

    Please see below my code:


    {
    xtype: 'gridpanel',

    flex: 1,
    height: 375,
    itemId: 'testItem',
    width: '100%',
    title: '',
    bind: {
    store: store
    },
    viewConfig: {
    height: 355,
    maxHeight: 355
    },
    listeners: {
    render: 'onGrdRender'
    },
    columns: [
    {
    xtype: 'gridcolumn',
    width: '13%',
    dataIndex: 'fname',
    text: '<b>Firsname</b>'
    },
    {
    xtype: 'gridcolumn',
    width: '18%',
    dataIndex: 'lname',
    text: '<b>Last Name</b>'
    }
    ],
    plugins: [
    {
    ptype: 'bufferedrenderer'
    },
    {
    ptype: 'gridexporter'
    }
    ],
    dockedItems: [
    {
    xtype: 'displayfield',
    dock: 'bottom',
    itemId: 'counted',
    fieldLabel: ''
    }
    ]
    }

  7. #7
    Sencha Premium User
    Join Date
    May 2016
    Posts
    20

    Default

    Ganesh,

    Based on your bufferedrenderer plugin...your grid is using a buffered store? If it is then I'm sorry I can't really help you with this one. So far it seems that grid exporting only support regular store. My team have to use the backend to export to Excel for grids using buffered store in our app.

    Maybe someone with more advanced knowledge on buffered store have an answer.

  8. #8
    Sencha User
    Join Date
    Jun 2014
    Posts
    82
    Answers
    1

    Default

    Thanks for your reply.

    Even I have removed bufferstore, Still I am getting the same issue

    Thanks,
    Ganesh. R

  9. #9
    Sencha Premium User
    Join Date
    May 2016
    Posts
    20

    Default

    For your gridpanel.js, try to add this under requires

    requires: [
    'Ext.grid.plugin.Exporter',
    'Ext.exporter.text.CSV',
    ]

Similar Threads

  1. How we can have Export Grid data to Excel / PDF
    By AtulDawkhare in forum Ext: Q&A
    Replies: 13
    Last Post: 19 May 2014, 10:04 PM
  2. Export Grid Data to Excel
    By Gunasekar.Jabbala in forum Ext: Q&A
    Replies: 3
    Last Post: 21 Mar 2013, 4:05 AM
  3. Export Ext.Grid data in CSV (not Excel)
    By Sam007 in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 5 Nov 2012, 10:38 AM
  4. Export Grid data to excel or pdf
    By Jay Tanwar in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 23 Mar 2012, 4:32 AM
  5. Export Grid Data into excel
    By Ajithamani in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 27 May 2010, 6:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •