【问题标题】:add a lot of rows with jsreport-core用 jsreport-core 添加很多行
【发布时间】:2021-06-22 01:46:05
【问题描述】:

this相关。

我有很多行要添加到报告中。报告可以是 excel 或 pdf 格式。 我想批量添加。 如何实现?

【问题讨论】:

  • 你想用什么食谱?为什么要使用批量而不是正常迭代?请分享一些例子..
  • 我想用 chrome-pdf 和 html 来做excel。例如,如果我有 100 万行需要添加到表中

标签: jsreport


【解决方案1】:

chrome-pdf 配方不支持批量。 html 生成通常足够快,chrome 使用多个线程来渲染大表,没有进一步优化的空间。

html-to-xlsx 配方包括针对大表的优化技术。要点是使用 htmlToXlsxEachRows 拆分行并批量运行转换。

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

有关详细信息,请参阅performance 部分。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-08-20
    • 2022-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多