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


Log in to reply
 

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