XLSX: Multiple {{#each var}} in a single cell



  • Is there a way of having 2 #each structures in the same excel file, something like this: 0_1731434105845_upload-39c238c4-1918-4571-9133-388bf711a8b5

    This gives you an error like this
    0_1731434184911_upload-742e1967-cf43-4205-b2f7-2c19f4dc8054


  • administrators

    what jsreport version are you using? i've done a test with latest jsreport (4.7.0) and it works.

    0_1731440158943_Screenshot 2024-11-12 at 2 .35.19@2x.jpg

    using this data

    {
        "data": [
            {
                "second": {
                    "records": [{
                        "first": "Boris",
                        "last": "2",
                        "value": 1
                    }, {
                        "first": "Matos",
                        "last": "22",
                        "value": 18
                    }, {
                        "first": "Jan",
                        "last": "12",
                        "value": 10
                    }, {
                        "first": "Blaha",
                        "last": "34",
                        "value": 8
                    }]
                }
            },
            {
                "second": {
                    "records": [{
                        "first": "Pablo",
                        "last": "48",
                        "value": 49
                    }, {
                        "first": "Juan",
                        "last": "92",
                        "value": 16
                    }, {
                        "first": "Martin",
                        "last": "45",
                        "value": 17
                    }, {
                        "first": "Jhon",
                        "last": "10",
                        "value": 7
                    }]
                }
            }
        ]
    }
    


  • Thanks for the quick reply. I also see that it works in 4.7.0. Currently we are still on 4.3.X. We are trying to upgrade to 4.7 but there are several things that I have posted issues with and I am waiting to hear back on back on. When will the public playground be upgraded to 4.7 it is still running 4.3?

    Again thank you, I can mark this off the list.


  • administrators

    about the pptx issues i am about to start checking those soon, and about the playground we will try to prioritize its update, our backlog is quite full so we are fixing and implementing features, so playground got a bit behind, but we will update it soon.



  • There is one more issue with this that I did not have in my original sample. Since I was trying to make it as simple as possible. We actually have this also.
    0_1731527454468_upload-cbe30b56-7626-492a-830c-7fa8f9f697d9

    Same dataset as before buy you just add a "total" property inside second

    {
    "data": [
    {
    "second": {
    "total": 36,
    "records": [
    {
    "first": "Boris",
    "last": "2",
    "value": 1
    },
    {
    "first": "Matos",
    "last": "22",
    "value": 18
    },
    {
    "first": "Jan",
    "last": "12",
    "value": 10
    },
    {
    "first": "Blaha",
    "last": "34",
    "value": 8
    }
    ]
    }
    },
    {
    "second": {
    "total": 89,
    "records": [
    {
    "first": "Pablo",
    "last": "48",
    "value": 49
    },
    {
    "first": "Juan",
    "last": "92",
    "value": 16
    },
    {
    "first": "Martin",
    "last": "45",
    "value": 17
    },
    {
    "first": "Jhon",
    "last": "10",
    "value": 7
    }
    ]
    }
    }
    ]
    }

    This outputs this
    0_1731528350580_upload-71fd76b5-094d-463f-929a-20881b386f14


Log in to reply
 

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