paginating multi-level data in pptx helper

  • Hello, I'm trying to paginate an inner data object represented by the suites table on the playground example. The max lines on that table can be max of 3. Is there a way to repeat a building record with remaining suites if there are more than 3 suites associated to a give building (as in building 432)? The overall max number of suites in a building can be upwards of 20 in production.

    I have seen a previous post discussing pagination here:, but I can't seem to be able to port this into a multilevel object structure like in the example.

  • administrators

    hi @lukuser

    i believe this should work, take a look

    i have modified the pptx to have this call at the top {{pptxSlides (chunksBySuites buildings)}} and then just added the chunksBySuites helper

    function* _chunk(buildings, maxSuites) {
      for (let i = 0; i < buildings.length; i ++) {
        const { suites, } = buildings[i]
        for (let j = 0; j < suites.length; j += maxSuites) {
            const newBuilding = { }
            newBuilding.suites = suites.slice(j, j + maxSuites)
            yield newBuilding;
    function chunksBySuites(buildings) {
        const maxSuites = 3
        return [..._chunk(buildings, maxSuites)]

Log in to reply

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.