Page 6 of 30 FirstFirst ... 4567816 ... LastLast
Results 51 to 60 of 296

Thread: GridPanel directly to Excel.

  1. #51
    Ext JS Premium Member
    Join Date
    Jun 2008
    Posts
    19
    Vote Rating
    0
      0  

    Default

    How do i set the filename to be used for saving?
    /Lars

  2. #52
    Sencha Premium User
    Join Date
    May 2007
    Posts
    46
    Vote Rating
    1
      0  

    Default

    in the response header, set:

    Content-Disposition:attachment;filename=export_filename.xls

  3. #53
    Ext JS Premium Member
    Join Date
    Jun 2008
    Posts
    19
    Vote Rating
    0
      0  

    Question set response header in javascript?

    But how do i set the response header in the client, with Javascript?
    /Lars

    Code:
     
    bbar: new Ext.Toolbar({
    buttons: [{
    id: 'grid-excel-button',
    text: 'Exportera till Excel...',
    handler: function(){
    document.location='data:application/vnd.ms-excel;base64,' + Base64.encode(Ext.getCmp("mygrid").getExcelXml());
    }
    }]
    })
     
    }

  4. #54
    Ext User
    Join Date
    Nov 2007
    Posts
    63
    Vote Rating
    0
      0  

    Smile null cell cause problem

    Hi,
    nice addon indeed.
    I have some date in my grid and each time a cell is null ( no date ), the code report an error in

    Code:
    if (cellType[k] == 'DateTime') {
    		t += v.format('d-m-Y');
    because v does not exist.

    any idea how I could fix it ?

    Thanks very much

    T

  5. #55
    Ext User
    Join Date
    May 2007
    Location
    jakarta
    Posts
    9
    Vote Rating
    0
      0  

    Default

    I think should be add with Ext.isEmpty ?
    like this
    Code:
    if (cellType[k] == 'DateTime') {
    if (Ext.isEmpty(v)==false) {
    t+=v.format('d-m-Y');
    }
    Last edited by mystix; 19 Jun 2008 at 5:46 PM. Reason: use [code][/code] tags

  6. #56
    Ext User
    Join Date
    Nov 2007
    Posts
    63
    Vote Rating
    0
      0  

    Default

    thank you.

    I fixed the error with empty date cell by doing that :
    Code:
    if (cellType[k] !== "None") {
    						if (!v) {t += '<ss:Cell ss:StyleID="' + cellClass +'"></ss:Cell>';}
    							
    						else {
    							t += '<ss:Cell ss:StyleID="' + cellClass + cellTypeClass[k] + '"><ss:Data ss:Type="' + cellType[k] + '">';
    								if (cellType[k] == 'DateTime') {
    									t += v.format('Y-m-d');
    								} else {
    									t += v;
    								}
    							t +='</ss:Data></ss:Cell>';
    						}
                        }
    and everything is fine.

    still no idea how to make it work on ie ?

  7. #57
    Ext User
    Join Date
    May 2008
    Posts
    21
    Vote Rating
    0
      0  

    Default

    Hi,

    I am using this .. but getting the following error -

    fld has no properties

    switch(fld.type) {
    on line 164 of ExportGridToExcel.js ...

    Any idea?

    I have a Grouping enabled grid that has first column as hidden.

    Thanks.

    Mihir

  8. #58
    Ext User
    Join Date
    May 2008
    Posts
    59
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by miihiir View Post
    Hi,

    I am using this .. but getting the following error -

    fld has no properties

    switch(fld.type) {
    on line 164 of ExportGridToExcel.js ...

    Any idea?

    I have a Grouping enabled grid that has first column as hidden.

    Thanks.

    Mihir
    First, sorry for my English.
    I have same error. That because I add RowAction in ColumnModel and it create field, that don't have cm.getDataIndex() property and it generate error.
    To fix :
    1. (about 148 row)
    Code:
    for (var i = 0; i < cm.getColumnCount(); i++) {
    if ((includeHidden || !cm.isHidden(i)) && (cm.getDataIndex(i))) {
    2. (about 204 row):
    Code:
     ss:ExpandedColumnCount="' + (visibleColumnCount +2) +
    '" ss:ExpandedRowCount="' + (this.store.getCount() + 2) + '">' +
    May be it is dirty, but work for me

  9. #59
    Ext User
    Join Date
    Apr 2008
    Location
    PARIS
    Posts
    9
    Vote Rating
    0
      0  

    Exclamation UTF8 issue

    Hi All,

    Animal, Thanks for this great extension.

    I get an issue with utf-8 encoding. If I have a word like this one 'Cr
    http://www.123messagepro.com convert your text into vocal message with background music !!

  10. #60
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,015
    Vote Rating
    182
      0  

    Default a

    It's all in the first post: This needs a browser that supports data URLs. FF, Opera and IE8 will support this.
    Last edited by mankz; 26 Jun 2008 at 3:44 AM. Reason: a

Page 6 of 30 FirstFirst ... 4567816 ... LastLast

Posting Permissions

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