Each xlsxAddImage Is duplicated



  • Hello, I am halfway towards my solution however I am having problems getting my images to correctly population my excel sheet.

    I am able to correctly place the images in the correct location and render the image. The problem is that it is only showing the first image repeated in each location.

    {{#each basephotos}}
    {{#xlsxAddImage "image" "sheet6.xml" column_from row_from column_to row_to}}
    {{image}}
    {{/xlsxAddImage}}
    {{/each}}

    My assumption is that something in the each loop is wrong. That it is hanging onto the original image and just rendering it over and over.

    Example of the basephotos that I iterate through:

    [
    {
    image: 'longStringOfImageEachDifferent'
    caption: 'test caption',
    column_from: 1,
    row_from: 13,
    column_to: 35,
    row_to: 33,
    caption_row: 34
    },
    {
    image: 'longStringOfImageEachDifferent'
    caption: 'test caption',
    column_from: 1,
    row_from: 13,
    column_to: 35,
    row_to: 33,
    caption_row: 34
    },
    {
    image: 'longStringOfImageEachDifferent'
    caption: 'This is another test',
    column_from: 1,
    row_from: 35,
    column_to: 35,
    row_to: 55,
    caption_row: 56
    },
    ...
    ]


  • administrators

    hi! hmm that part of your code seems to be fine, however maybe the issue can be somewhere and in that case, we need the full context of the report, maybe you can upload the problem to the playground and we can check it.


  • administrators

    so we solve this internally via email. the problem was that #xlsxAddImage was not receiving different image name per each iteration of the loop


Log in to reply
 

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