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.

    0_1750245557929_upload-aa1a2d26-b982-4593-8387-407f79459fe7

    But as soon as I download the file and open in Excel, it does not show as a whole text. It shows truncated:

    0_1750245642940_upload-ccb08767-4501-469d-a907-490f605afed0


  • administrators

    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.

    0_1750286605855_Screenshot 2025-06-18 at 5 .43.13@2x.jpg



  • 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?


  • administrators

    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.

    0_1750342450812_upload-d75b28d6-5cd6-4f51-a351-464226eb0c7b

    But the file that is generated using jsreport does not show the complete text.


  • administrators

    0_1750343020669_Screenshot 2025-06-19 at 9 .22.38@2x.jpg

    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


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.