xlsx-template icon indicating copy to clipboard operation
xlsx-template copied to clipboard

Table with an array of 1 causes problem

Open evanslify opened this issue 7 years ago • 4 comments

t.substitute(1, {
    titles: ['title1', 'title2'],
    planData: [
        { name: 'A', role: ['role1'] },
        { name: 'B', role: ['role2'] }
    ]
});

With a input like this

image

Would result a file which excel would complain upon opening. This is due to duplicate element inside sheet1.xml.

    <row ht="14" r="2" spans="1:7" x14ac:dyDescent="0.2">
      <c r="A2" t="s">
        <v>6</v>
      </c>
      <c r="B2" s="6" t="s">
        <v>8</v>
      </c>
      <c r="B2" s="6" t="s">
        <v>3</v>
      </c>
    </row>

evanslify avatar Dec 06 '17 08:12 evanslify

Please see https://github.com/evanslify/xlsx-template/commit/796b7f1c4a76d618fa26b4b452b22b14fd35d51f

I have added a test to fail.

evanslify avatar Dec 06 '17 08:12 evanslify

I have monkey-patched to prevent this double-insertion of cells, but a better way of fixing it could be of use.

evanslify avatar Dec 07 '17 09:12 evanslify

After 6 months. Ping. @optilude @kant2002

evanslify avatar May 19 '18 07:05 evanslify

@evanslify sorry for missing this. If you made PR, I review and very likely accept it.

kant2002 avatar May 19 '18 12:05 kant2002