Search code examples
jsreport

add a lot of rows with jsreport-core


relates to this.

I have a lot of rows to add to the report. the report can be in excel or pdf. and I want to add it in bulks. how it can be achieved?


Solution

  • The chrome-pdf recipe doesn't support bulks. The html generation is typically fast enough and chrome uses multiple threads to render big tables and there is no space for further optimization.

    The html-to-xlsx recipe includes optimization techniques for big tables. The main point is to use the htmlToXlsxEachRows which splits rows and runs the conversion in bulks.

    <table>
        {{#htmlToXlsxEachRows people}}
          <tr>
            <td>{{name}}</td>
            <td>{{address}}</td>
          </tr>
        {{/htmlToXlsxEachRows}}
    </table>
    

    See the performance section for the further information.