1. #201
    Sencha Premium Member tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,688
    Vote Rating
    112
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      0  

    Default


    hi nige,

    i tested your ux a bit more (i told you i like it before, but again: nice work!).

    i am using firefox3.1 and data that should be utf-8 inside the datastores.

    when exporting to excel, the part

    Code:
    encode : (typeof btoa == 'function') ? function(input) { return btoa(input); } : function (input) {
                var output = "";
                var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
                var i = 0;
                input = utf8Encode(input);
                ...
    made different results in the output with btoa and the directly posted method.
    in btoa seems to be just an encode to base64 without the utf8encode() before. so, with btoa special characters got "destroyed".

    i just removed it therefore

    Code:
    encode : function (input) {
                var output = "";
                var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
                var i = 0;
                input = utf8Encode(input);
                ...
    the other thing is, that gridPlugins like rowNumberer cause troubles. as a kind of hotfix i count from column 1 instead of 0 all the times (since i always use the plugin).

    kind regards, tobiu

  2. #202
    Ext User
    Join Date
    Apr 2009
    Posts
    6
    Vote Rating
    0
    Boccara Jonathan is on a distinguished road

      0  

    Default


    Hello Animal.
    I try to use your code with my GridPanel where the data are loaded with Ext.data.HttpProxy.
    When I click on the button Excel I have the following error with firebug :
    Code:
    [Exception... "'<error>' when calling method: [nsIContentHandler::handleContent]" nsresult: "0x805d0001 (<unknown>)" location: "<unknown>" data: no]
    Can you help me to resolve it.

    Thank you.

  3. #203
    Ext User
    Join Date
    Dec 2007
    Posts
    2
    Vote Rating
    0
    vietschv is on a distinguished road

      0  

    Default Russioan characters or other (non-european) languages

    Russioan characters or other (non-european) languages


    Does anybody know why the export2excel plugin causes problems with non-europpean characters, like russian ones? I thought that this should not be a problem using utg8 encoding.

    Thanks for any help,
    vietschv

  4. #204
    Ext User
    Join Date
    Oct 2008
    Posts
    1
    Vote Rating
    0
    naranda is on a distinguished road

      0  

    Default


    Hi, I tried the next code for export to excel and runs on IE7, IE8 and FF


    Code:
    
    function export(dato){
        if (!Ext.fly('frmDummy')) {
            var frm = document.createElement('form');
            frm.id = 'frmDummy';
            frm.name = id;
            frm.className = 'x-hidden';
            document.body.appendChild(frm);
          }
        Ext.Ajax.request({
            url: 'export_excel.php',
            method : 'POST',
             form: Ext.fly('frmDummy'),
             callback: function(o, s, r){
                alert(r.responseText);
              },
            isUpload: true,
            params: { ex: dato }
        });
        
    }
    bbar in grid:
    Code:
    bbar: new Ext.Toolbar({
                    buttons: [{
                        id: 'grid-excel-button',
                        text: 'Exportar a Excel',
                        handler: function(){
                            
                            var exportContent =grid.getExcelXml();
                            
                            export(exportContent);
                        }
                     }]
                }),
    See ya!!


    PD: my english is bad

  5. #205
    Ext User
    Join Date
    Mar 2009
    Location
    Bucharest
    Posts
    2
    Vote Rating
    0
    Galileo_Galilei is on a distinguished road

      0  

    Default Any news to this IE bugg?

    Any news to this IE bugg?


    Hy guys. It's been a while from the first recording of this problem:
    Default Error in IE8
    Hi All,

    Export to Excel works fine in FF, but in IE8 I get this error -

    Message: The data area passed to a system call is too small.

    Can anybody please tell me how to fix this?


    and I still face this. Dear Animal, are u kind to give us an update about this? Stil no fix for it? Your last update about this:
    Report it to McSoft. I would guess it's an IE error caused by using a data: URL. If it's a large dataset, then the BASE64 encoding of an XML spreadsheet will be large. The whole content is encoded into the href of a link as the URL. Looks like IE8 just cannot cope.
    Maybe I missed something from the thread?
    Thank you for your constant support!

  6. #206
    Ext JS Premium Member Joyfulbob's Avatar
    Join Date
    Feb 2008
    Posts
    176
    Vote Rating
    1
    Joyfulbob is on a distinguished road

      0  

    Default


    Quote Originally Posted by snoir View Post
    thx,emredagli.the code is ok.

    [/code]my jsp:
    HTML Code:
    <% response.setHeader("Pragma","public");
     response.setHeader("Expires","0");
     response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
     response.setHeader("Content-Type","application/force-download");
     response.setHeader("Content-Type","application/vnd.ms-excel");
     response.setHeader("Content-Disposition","attachment;filename="+request.getParameter("FileName"));
     
     out.print(request.getParameter("ex"));
     %>
    Thanks for this update. I ran it in IE7 and I get that 'data too small' error. I don't have jsp's; am using an .htm file; can you suggest equivalent code for the quoted above?
    Thanks in advance!

  7. #207
    Ext User
    Join Date
    Aug 2009
    Posts
    2
    Vote Rating
    0
    teraphy is on a distinguished road

      0  

    Default


    Quote Originally Posted by Galileo_Galilei View Post
    Hy guys. It's been a while from the first recording of this problem:
    Default Error in IE8
    Hi All,

    Export to Excel works fine in FF, but in IE8 I get this error -

    Message: The data area passed to a system call is too small.

    Can anybody please tell me how to fix this?


    and I still face this. Dear Animal, are u kind to give us an update about this? Stil no fix for it? Your last update about this:
    Report it to McSoft. I would guess it's an IE error caused by using a data: URL. If it's a large dataset, then the BASE64 encoding of an XML spreadsheet will be large. The whole content is encoded into the href of a link as the URL. Looks like IE8 just cannot cope.
    Maybe I missed something from the thread?
    Thank you for your constant support!
    The first post is a little misleading. I assumed it would work in IE8 due to the first comment. I then skimmed the 21 pages to see if there was any response to a positive IE8, now I suspect no one can get it working in IE8. After quite a bit of testing and searching to figure this out it appears IE8 doesn't support data URIs for this situation.

    IE8 only allows for data URIs in img tags and CSS. I simply tested by attempting to enter the data directly into the navigation bar with no luck for IE8 and I finally found this Mozilla article to confirm it: https://developer.mozilla.org/en/The_data_URL_scheme

    A MSDN reference: http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
    Data URIs cannot be used for navigation

  8. #208
    Sencha User
    Join Date
    Apr 2008
    Posts
    330
    Vote Rating
    0
    Jack_S is on a distinguished road

      0  

    Exclamation XML Problem with 3.0 Grids

    XML Problem with 3.0 Grids


    Hello All,

    I seem to be getting errors when I open up the worksheet in Excel. I've reviewed the log files and found the following.

    I've recently upgraded all my grids to 3.0 to take advantage on some of the new features.

    I'm using Office 2007, including the Formating pack and still I can't get this plugin to work with Grids 3.0.

    Can anybody offer any assistance?? Here is snippet of my log file.

    Thanks in advance.

    Jack

    Code:
    XML ERROR in Table
    REASON:	Bad Value
    FILE:	C:\Users\JanS.OSWORILOCAL\Desktop\something.xls
    GROUP:	Cell
    TAG:	Data
    ATTRIB:	Type
    VALUE:	undefined
    
    XML ERROR in Table
    REASON:	Bad Value
    FILE:	C:\Users\JanS.OSWORILOCAL\Desktop\something.xls
    GROUP:	Row
    TAG:	Cell
    ATTRIB:	StyleID
    VALUE:	evenundefined
    
    XML ERROR in Table
    REASON:	Bad Value
    FILE:	C:\Users\JanS.OSWORILOCAL\Desktop\something.xls
    GROUP:	Cell
    TAG:	Data
    ATTRIB:	Type
    VALUE:	undefined
    
    XML ERROR in Table
    REASON:	Bad Value
    FILE:	C:\Users\JanS.OSWORILOCAL\Desktop\something.xls
    GROUP:	Row
    TAG:	Cell
    ATTRIB:	StyleID
    VALUE:	oddundefined
    I take it that it has to do with the part of the code which generates the cell data. I have not found anything but it seems that "odd" and "even" are undefined.

    Code:
    // Generate the data rows from the data in the Store
            for (var i = 0, it = this.store.data.items, l = it.length; i < l; i++) {
                t += '<ss:Row>';
                var cellClass = (i & 1) ? 'odd' : 'even';
                r = it[i].data;
                var k = 0;
                for (var j = 0; j < cm.getColumnCount(); j++) {
                    if (includeHidden || !cm.isHidden(j)) {
                        var v = r[cm.getDataIndex(j)];
                        if (cellType[k] !== "None") {
    
    	                    t += '<ss:Cell ss:StyleID="' + cellClass + cellTypeClass[k] + '"><ss:Data ss:Type="' + cellType[k] + '">';
    	                        if (cellType[k] == 'DateTime') {
    	                            t += v.format('d/m/Y');
    	                        } else {
    	                            t += v;
    	                        }
    	                    t +='</ss:Data></ss:Cell>';
                        }
                        k++;
                    }
                }
                t += '</ss:Row>';
            }

  9. #209
    Ext User
    Join Date
    Aug 2009
    Posts
    2
    Vote Rating
    0
    teraphy is on a distinguished road

      0  

    Default


    I think you're missing the styles that define even/odd.

    Code:
    '<ss:Style ss:ID="even">' +
                        '<ss:Interior ss:Pattern="Solid" ss:Color="#CCFFFF" />' +
                    '</ss:Style>' +
                    '<ss:Style ss:Parent="even" ss:ID="evendate">' +
                        '<ss:NumberFormat ss:Format="[ENG][$-409]dd\-mmm\-yyyy;@" />' +
                    '</ss:Style>' +
                    '<ss:Style ss:Parent="even" ss:ID="evenint">' +
                        '<ss:NumberFormat ss:Format="0" />' +
                    '</ss:Style>' +
                    '<ss:Style ss:Parent="even" ss:ID="evenfloat">' +
                        '<ss:NumberFormat ss:Format="0.00" />' +
                    '</ss:Style>' +
                    '<ss:Style ss:ID="odd">' +
                        '<ss:Interior ss:Pattern="Solid" ss:Color="#CCCCFF" />' +
                    '</ss:Style>' +

  10. #210
    Sencha User
    Join Date
    Apr 2008
    Posts
    330
    Vote Rating
    0
    Jack_S is on a distinguished road

      0  

    Thumbs up


    Hi All,

    Found what the issue was, the header were ignoring the cellRenders such as NumberedRow/CheckBox Slection, but inside the data is was actually counting from the rendered cell which means that the last cell was always undefined.

    I used one of the simple fixes suggested by one of the posters and started to count from 1 rather then zero.

    Thanks

    Jack

    Code:
    //Around line 220
     // ORIGINAL
    	// Generate the data rows from the data in the Store
            for (var i = 0, it = this.store.data.items, l = it.length; i < l; i++) {
                t += '<ss:Row>';
                var cellClass = (i & 1) ? 'odd' : 'even';
                r = it[i].data;
                var k = 0;
                for (var j = 1; j < cm.getColumnCount(); j++) {

Thread Participants: 142

  1. alexb (1 Post)
  2. galdaka (3 Posts)
  3. ghyster (1 Post)
  4. Condor (1 Post)
  5. TopKatz (1 Post)
  6. Jul (1 Post)
  7. mystix (3 Posts)
  8. Foggy (2 Posts)
  9. bloon (1 Post)
  10. fshort (1 Post)
  11. antimatter15 (1 Post)
  12. cocinerox (1 Post)
  13. tobiu (1 Post)
  14. ajaxE (2 Posts)
  15. andreyz (1 Post)
  16. devnull (4 Posts)
  17. mjlecomte (4 Posts)
  18. kevinwu8 (1 Post)
  19. rakesh (1 Post)
  20. hendricd (2 Posts)
  21. gelleneu (1 Post)
  22. isaac (1 Post)
  23. huling (1 Post)
  24. ckr (1 Post)
  25. roopa (1 Post)
  26. loveyeah (1 Post)
  27. zhfxu_cs (1 Post)
  28. Mthor (1 Post)
  29. johnlicy (1 Post)
  30. thoreking (2 Posts)
  31. csqjean (1 Post)
  32. mankz (1 Post)
  33. vietschv (1 Post)
  34. verbi (1 Post)
  35. sanjshah (2 Posts)
  36. mask_hot (1 Post)
  37. calavera (1 Post)
  38. vsmike (1 Post)
  39. vizcano (1 Post)
  40. lakehouse (1 Post)
  41. alaska (2 Posts)
  42. radtad (3 Posts)
  43. jmcneese (1 Post)
  44. Rafael (4 Posts)
  45. calvouze (1 Post)
  46. Joyfulbob (1 Post)
  47. angeldimitrov (2 Posts)
  48. Jack_S (2 Posts)
  49. g13013 (2 Posts)
  50. DamienValentine (5 Posts)
  51. Marcelo Delgado (1 Post)
  52. NoahK17 (8 Posts)
  53. anujg (1 Post)
  54. aproust94 (3 Posts)
  55. pokerking400 (1 Post)
  56. Ronhead (1 Post)
  57. krzak (3 Posts)
  58. cvieira (1 Post)
  59. Efex (5 Posts)
  60. gthe (2 Posts)
  61. miihiir (2 Posts)
  62. pops (1 Post)
  63. emredagli (12 Posts)
  64. larsa (2 Posts)
  65. maggiesnyder (3 Posts)
  66. sam.zhang (1 Post)
  67. kristalgic (1 Post)
  68. wiznia (3 Posts)
  69. frpucci (1 Post)
  70. tinakonda (1 Post)
  71. tBSTAR (1 Post)
  72. tdg2008 (1 Post)
  73. iwagon (1 Post)
  74. psarunkumar (1 Post)
  75. kimmking (1 Post)
  76. sKuD24 (1 Post)
  77. MartinL (2 Posts)
  78. BitPoet (2 Posts)
  79. snoir (3 Posts)
  80. naranda (1 Post)
  81. zhw511006 (1 Post)
  82. bobjbain (1 Post)
  83. korto (1 Post)
  84. wp.joju (1 Post)
  85. hastiok (6 Posts)
  86. dtondo (4 Posts)
  87. Dumas (1 Post)
  88. vvreddy@12 (4 Posts)
  89. TheBim (1 Post)
  90. whodat (2 Posts)
  91. Skunkerbr (2 Posts)
  92. stevenhzj (4 Posts)
  93. Naokai (1 Post)
  94. wayned@escc (2 Posts)
  95. MuadDib-DK (1 Post)
  96. jsundquist (1 Post)
  97. hardc0re (2 Posts)
  98. hzwei (4 Posts)
  99. Galileo_Galilei (1 Post)
  100. SantaBarbarian (4 Posts)
  101. stevieke (1 Post)
  102. megmefleg (1 Post)
  103. Boccara Jonathan (1 Post)
  104. Surinder singh (2 Posts)
  105. KrullWarKing (1 Post)
  106. brandnewdrew (1 Post)
  107. MrRoyce (1 Post)
  108. Spongerusher (1 Post)
  109. teraphy (2 Posts)
  110. Pekka Karalahti (3 Posts)
  111. Sergii (1 Post)
  112. Cassio11 (1 Post)
  113. myth (1 Post)
  114. spor (6 Posts)
  115. StagnantIce (2 Posts)
  116. shailendra (2 Posts)
  117. ext_user1 (1 Post)
  118. kenny_mk (1 Post)
  119. mpacheco (1 Post)
  120. Centurus (1 Post)
  121. andyfly (1 Post)
  122. darmandovargas@gmail.com (1 Post)
  123. zjuthhy (3 Posts)
  124. robshim (3 Posts)
  125. Tod (1 Post)
  126. bipen (2 Posts)
  127. alisyah (1 Post)
  128. Monz87 (1 Post)
  129. alssst (1 Post)
  130. aggie (1 Post)
  131. bradelsky (1 Post)
  132. lagrezd (1 Post)
  133. ma1986 (1 Post)
  134. Sabareesh (2 Posts)
  135. top_1 (1 Post)
  136. Vasanthoo7 (1 Post)
  137. garrek99 (2 Posts)
  138. opik (1 Post)
  139. zaburo (1 Post)
  140. shankar8rajah1 (1 Post)
  141. tdobberphul (4 Posts)
  142. jramis (1 Post)