Skip to main content

PaprizeReport

The PaprizeReport class is responsible for building the report and handling pagination. You need to create an instance of it with the desired options.

After organizing your report with Report Components, you must register each section within the PaprizeReport instance. Provide a unique ID, specify the page size, and define other SectionOptions. Once configured, you can schedule a pagination operation.

During pagination, the report replaces your initial DOM content. While the process runs, the report components are hidden from the user. Note that the scheduler does not support parallel pagination operations, see details here.

If you need access to page information (e.g., page number or total pages), subscribe to the pagination events and modify the paginated content accordingly, as described in PageInfo.

Changes to the initial DOM elements have no effect, since the pagination engine operates on cloned elements. All original state and event handlers attached to the initial DOM will be lost during the pagination process.

import { pageSize, pageMargin } from '@paprize/core';
import { PaprizeReport } from '@paprize/vanilla';

const report = new PaprizeReport();

report.addSection({
id: 'section-1',
dimension: pageSize.A4,
margin: pageMargin.Narrow,
...configs,
});

await r.schedulePagination();