JSreport for converting JSON to XLSX format
-
Hi Team
We are trying to map an output Json to xlsx using xlsx recipe. Our previous developer had provided a mapping as below but unable to determine the correct row and column values. Could you please help us on how this template is coded?
{{!--Name & Details--}} {{#xlsxReplace "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row[2].c[1]"}} <c t="inlineStr"><is><t>{{data.page2FullName}}</t></is></c> {{/xlsxReplace}} {{#xlsxReplace "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row[3].c[1]"}} <c t="inlineStr"><is><t>{{data.page2PanelEmail}}</t></is></c> {{/xlsxReplace}}
-
I'm not sure I get the question...
The following
worksheet.sheetData[0].row[2].c[1]
should represent the 3th row and 2nd column inside the xslx.
This doesn't necessarily mean its cellC2
, because the previous cells can be empty and in this case excel doesn't add them to therow
collection. You can unzip the excel template, find filesheet1.xml
and find whats inside thesheetData.row
nodes. Or just try to run the template in jsreport, replace cell and see where it gets actually replaced.