1. #1
    Ext User
    Join Date
    Dec 2008
    Location
    Netherlands
    Posts
    16
    Vote Rating
    -1
    Angelgab82 is an unknown quantity at this point

      0  

    Default Export Extjs/ Grid Filter to Excel:

    Export Extjs/ Grid Filter to Excel:


    First I would like to thank ambience who created the Grid Filter plug-in (wonderful job) and Animal for the great export to excel plug-in.

    At my job I was required to create a Grid-Filter that exports Excel based on the filter, after making a research I reached a point that I could achieve it.

    The example shows the Grid Filter (with php), I added the page exportxml.php which exports the filtered results into Excel and I added the folder (App_data) inside it the config.php file and class.mysql.php with checkurl.php.

    The export is done from the mysql query not from the Javascript.

    I’m new in php not much familiar most probably you will find the code not clean but I hope I can help others to achieve better coding.

    In the excel if your using easy php on windows there is two declaration errors but in case of Linux no such errors.

    Tested on IE8, FF, Chrome, Safari.


    Best Regards,
    Gabriel
    Attached Files

  2. #2
    Sencha User BitPoet's Avatar
    Join Date
    Sep 2008
    Location
    Bavaria
    Posts
    277
    Vote Rating
    1
    BitPoet is on a distinguished road

      0  

    Default


    You should really use mysql_*escape functions on all input values in php instead of doing error-prone blacklisting of selected SQL terms - especially seeing that you are filtering REQUEST_URI while taking your values $_REQUEST instead of $_GET, which makes it easy for a possible attacker to circumvent your filter by submitting bad values via POST.

  3. #3
    Ext User
    Join Date
    Dec 2008
    Location
    Netherlands
    Posts
    16
    Vote Rating
    -1
    Angelgab82 is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by BitPoet View Post
    You should really use mysql_*escape functions on all input values in php instead of doing error-prone blacklisting of selected SQL terms - especially seeing that you are filtering REQUEST_URI while taking your values $_REQUEST instead of $_GET, which makes it easy for a possible attacker to circumvent your filter by submitting bad values via POST.
    Thanks Bit for your help and advice, I didn't give the security much of time because this script is running intranet my idea was printing out from the mysql itself after filtering the grid.

    Best regards,
    Gabriel

  4. #4
    Ext User
    Join Date
    Jun 2007
    Posts
    187
    Vote Rating
    1
    anjelika is on a distinguished road

      1  

    Default


    Hi,
    Works nice on filters but how do you export to excel?
    Couldn't find any button for that.
    Thanks

  5. #5
    Ext User
    Join Date
    Dec 2008
    Location
    Netherlands
    Posts
    16
    Vote Rating
    -1
    Angelgab82 is an unknown quantity at this point

      -1  

    Default


    Quote Originally Posted by anjelika View Post
    Hi,
    Works nice on filters but how do you export to excel?
    Couldn't find any button for that.
    Thanks
    In the example its already added.

    In the file grid-filter.js:
    Code:
    var grid = new Ext.grid.GridPanel({
       id: 'example',
       title: 'Grid Filters Example',
       ds: ds,
       cm: cm,
       enableColLock: false,
       loadMask: true,
       plugins: filters,
       height:400,
       width: 700,        
       el: 'grid-example',
        autoExpandColumn: 'company',
       bbar: new Ext.PagingToolbar({
         store: ds,
         pageSize: 15,
         plugins: filters,
              buttons: [{
             id: 'grid-excel-button',
             text: 'Export to Excel...',
                            handler: function(){
                                document.location = 'exportxml.php';
                            }
            }]
       })
     });
     grid.render();
    Attached Images
    Last edited by mystix; 8 Mar 2009 at 6:32 PM. Reason: POST CODE IN [CODE][/CODE] TAGS. see http://extjs.com/forum/misc.php?do=bbcode#code

  6. #6
    Ext User
    Join Date
    Jun 2007
    Posts
    187
    Vote Rating
    1
    anjelika is on a distinguished road

      0  

    Default


    OK found it, thanks.
    I was unzipping the content to the wrong ext folder:P
    Is there a way to customize the excel headers (add some color, width, etc..)?
    Thanks

  7. #7
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
    petrabudikarunia is on a distinguished road

      0  

    Default


    Hi, I have tried that.. the grid appears, but there is no record at all..

  8. #8

  9. #9
    Sencha User
    Join Date
    Mar 2011
    Location
    Bangalore,india
    Posts
    14
    Vote Rating
    0
    vineetmangal is on a distinguished road

      0  

    Question


    Hi Angelga,

    Thanks for your Efforts for this kinda of brilliant development. I tested this in Extjs 3.2.1 and IE8, Chrome 9.0 and FF7.0..but this is functioning in FF only.Can you please help me to come out of this problem so that i can use this in my project.

    Thanks in Advance.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar