muk-it / muk_web

MuK Odoo Web Modules
GNU Lesser General Public License v3.0
109 stars 232 forks source link

Preview MS Office Module Issues - Odoo 11 - .xlsx docs #60

Closed kopeyev closed 5 years ago

kopeyev commented 5 years ago

If the number of columns in the first row is not equal to the number of others, it is not converted correctly, in short, it converts only the number of columns in each row that the first row contains. I put a screenshot and a document below. image

Форма отчетности (2).xlsx

kopeyev commented 5 years ago

Tried to open same doc with english contents form_otch.xlsx screen

kopeyev commented 5 years ago

It converts only the number of columns in each row that the first row contains. Simplest example screen_xlsx test_xlsx.xlsx

kopeyev commented 5 years ago

SOLVED. In muk_web_preview_msoffice/static/src/js/preview_handler.js after line 119 ("""$pane.attr('id', 'sheet-' + index);""") add following: """var maximum_arrs = 1; sheet.forEach(function (arr) { if(arr.length>maximum_arrs){ maximum_arrs = arr.length; } }); sheet.forEach(function (arr) { if(arr.length<maximum_arrs){ for (var i = arr.length; i < maximum_arrs; i++) { arr.push(""); } } });"""

keshrath commented 5 years ago

Can you make a PR?

kopeyev commented 5 years ago

What the PR? I think that the problem is in using handsontable libs

keshrath commented 5 years ago

Since you have found a solution, you are welcome to make a pull request, with a corresponding fix.

kopeyev commented 5 years ago

Oh, cool)