Conditional section break for landscape page



  • Hello,

    Is it possible to somehow have a section break for a conditional landscape page in docx? In fact, I have a condition {{#if hasCategories}} and we put a section break (next page) next to it so that the page is in landscape format and we display a table, otherwise we don't have a new page. I tried but when I put the section break after the "if" I end up with no new page but my entire document in landscape format. It can be summarized by :
    --- page 1 ---
    {{#if hasCategories}}
    section break (next page)
    --- page 2 ---
    Landscape page with table
    {{/if}}

    Thanks in advance.


  • administrators

    hi! the {{docxPageBreak}} has not been tested with more complex conditional logic. so i would not expect what you want to work, however you can share with us the template you have so we can take a look, maybe we find an easy solution to make it work, but we need a proper test case to run.



  • Hello, thank you for your reply. This is what my template looks like. I deleted a lot of elements to send it to you, but it should work the same.
    We have the "if" condition with the section break :
    0_1750318622068_upload-845ccfc0-9f4c-4fe3-b7fe-59f0e06318a8
    Then I have a table and another section break :
    0_1750318658496_upload-b5f609b7-b4a7-4f6b-8de5-b60f1fcfe44e
    Finally, the landscape page with a table :
    0_1750318691842_upload-7d50d8aa-a962-4a24-824d-e41371b72449

    If we do not enter the condition, I do not have the last two pages as wanted but then my pages end up in landscapes


  • administrators

    can you attach these as an export file? if the attachment here does not work send me the file via email to bjrmatos@gmail.com


  • administrators

    FYI we have included changes to make the section breaks to work. it is available with jsreport 4.10.0, you can do a test of it.



  • Hi @bjrmatos

    Could you let me know where I can find more details about the changes related to the section break? I'm asking because we encountered the opposite situation: our template works correctly with JSReport v4.9, but all later versions produce incorrect results when conditionally rendering a section break.


  • administrators

    hi @andribo the changes are these, if you have a case where a previous template was working, please share all the details so we can fix the implementation or investigate the reason for the result.


Log in to reply
 

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