using html-to-xlsx with <td data-cell-type="date" data-cell-format-str="mm/dd/yy"> throw error if value does not exists



  • I using the data-cell-type to format the Excel. The problem I am having is that if there is no date for that line.
    I know I could wrap it with
    {{#if date}}<td data-cell-type="date" data-cell-format-str="mm/dd/yy">...</td>{{else}}<td></td>{{/if}}

    But, I was hoping there is another way.


  • administrators

    it looks the best that you can do, i mean it is expected that you provide some if you want some date cell. or maybe we can just put empty cell if we detect than invalid date value is passed. what is the error that you get? if i use this <td data-cell-type="date" data-cell-format-str="mm/dd/yy"></td> i just get NaN as result in the cell, but no error message



  • in the jsreport.config,json I've turned off the preview with
    "html-to-xlsx": {
    "previewInExcelOnline": false
    }
    The Error occurs when trying to open in Excel. (something about the excel file need to be repaired)
    I think an empty cell would work, But, it would leave that cell un-formatted.
    The best would be to format the cell and leave it value blank.


Log in to reply
 

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