How to put names on sheets?
-
Is there any way I can change the name of the sheets?
(I use a {{#each}} to create each of these tables)
and I wanted each one to have the name of a variable that is inside each loop.
-
You should find the solution in the following example
https://playground.jsreport.net/w/jan_blaha/wFq~T2U1
-
i'm using html-to-xlsx
-
https://playground.jsreport.net/w/admin/Ds9ngUSx
{{#each items}} <table name="{{myVarForSheetName}}"> <tr> <td>1</td> </tr> </table> {{/each}}
-
{{#each datasource}} {{#if companyDescription}} <table class="table" id="tabela" data-sheet-name={{companyDescription}}>
I tried to do it like this, but then I got an error:
Since, in the first sheet, more than one word should have appeared, and in the others this error appears: "recovered_sheet".
-
Please share playground demo.
-
https://playground.jsreport.net/w/anon/8k9Qyj1f
I was testing, basically if the name has a space, it only takes the first word, and as they all start with the same word, it gives this "recovered sheet" error, so the solution for now will be to try to put a dash between each word.
-
You need to use quotes
<table class="table" id="tabela" data-sheet-name="{{companyDescription}}">
-
Ahhhh!
Thank you very much, I didn't notice that.