Text in a cell is not visible as whole: html-to-xlsx
-
https://playground.jsreport.net/w/anon/oC498X3B
We are using html-to-xlsx recipe with cheerio.
Please refer to this workspace.
When I view the preview in jsreport, the text in the first cell is visible as a whole even if the cell width is less and the content is exceeding. Because the next cells are empty.But as soon as I download the file and open in Excel, it does not show as a whole text. It shows truncated:
-
hi!
that the browser preview and the local Excel have a difference is a bug in the browser preview, which we don't have control over. always trust the local Excel preview.
however, if you click the cell in the browser preview, you will notice that it has the expected width, just that for some reason the rest of the content is visible because the next cells are empty, we can not change that, the browser preview is something we don't have control.
-
If we create an Excel manually on our PC with the same content, in that case, the behaviour is the same, like if the rest of the cells are empty, the complete text is visible.
It is when the file is generated using jsreport with same text width and cell content, the text is not visible. What could be the cause?
-
It is when the file is generated using jsreport with same text width and cell content, the text is not visible. What could be the cause?
unfortunately the browser preview is a black box, we can not know the exact reason you are experiencing these differences
-
I understand that browser preview is a black box.
But the following screenshot is from the Excel that I created manually on my PC. In that the complete text is visible.
But the file that is generated using jsreport does not show the complete text.
-
this is how it looks for me using MS Excel on macOS. text truncated as expected because you are using a custom width in the HTML. i don't know why it looks different to you, is this MS Excel from Windows?
-
Yes MS Excel in Windows.
-
Thanks for posting. We have now analysed it more deeply.
The problem is that with an empty cell, we still render an empty tag (<v></v>
) to the Office XML, which prevents the overflow from the previous cell.We will fix this here
https://github.com/jsreport/jsreport/issues/1242