xlxs template - cell data-type is not defined by Excell

  • Hi, I have a xlxs template with dynamic data that I export to excel.
    The problem is I didn't find any way excel recognize cell data-type, I mean when I click on excel cell it displays not Generic data-type but number or date0_1684658340428_JSReportPicture.png for example
    This is my template:
    {{#each ../data.TableHeaderMapper}}
    <c t="inlineStr">
    <t>{{getTd ../this this}}</t>

  • This is defined in the cell s attribute which is a reference to the styles.xml.

         <c s="1"><v>11</v></c>

    You can either find out the right s value in an existing xlsx template you use or use xlsx helpers to update the styles.xml. Like here


    {{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}
            <c s="1"><v>11</v></c>
    {{#xlsxReplace "xl/styles.xml" "styleSheet.cellXfs"}}
       <cellXfs count="2">
    		<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>
    		<xf numFmtId="2" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>

    As always with xlsx transformations, it requires you to check how the XML structure looks like inside existing xlsx files and replicate the same with xlsx helpers.

Log in to reply

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