Issue with declaring a cell of "date" type in "xlsx" recipe



  • Hello jsreport team,

    I need to prepare an Excel report using the xlsx recipe (NOT html-to-xlsx). There will be a column to show the date. Unfortunately, I failed to set "date" as the cell type.

    This link (http://officeopenxml.com/SScontentOverview.php) says that the cell type for the date is "d", that is -

    <c t="d"><v>Some Date</v></c>

    But this didn't work for me. When I try to preview the report on MS Excel or on Google Sheet, it fails to manage that date type cells.

    I also tried to find out the type of a date type cell by unzipping an excel file but found no hints.



  • The trick mentioned in the http://officeopenxml.com/SScontentOverview.php doesn't seem to work for me as well.
    If I create in excel a cell with date formatting. It defines the date format using style in the file xl\styles.xml

    <cellXfs count="2">
    		<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>
    		<xf numFmtId="14" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>
    	</cellXfs>
    

    If I use the same style for the cell (<c s='1'...) it properly formats the date.
    https://playground.jsreport.net/w/anon/Uq8QQFxW


Log in to reply
 

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