Word - Template - Hide block if empty

Posted by: vincent.boyer.ucf on 5 October 2022, 3:28 am EST

    • Post Options:
    • Link

    Posted 5 October 2022, 3:28 am EST

    Hi,

    I’m keeping on testing your product and there is one another thing I don’t understand how it works.

    Hide-block-if-empty.

    I have a block of shipping address.

    In this block, I have 5 lines (with 3 optional and linebreaker foreach line) + zip code + city

    With HBI-empty, if line 4 is empty, everything is hidden.

    I just want the line and the breaker hidden.

    How to do that ?

  • Posted 6 October 2022, 12:58 am EST

    Hello Vincent,

    The HBI-empty hides the particular block in which it is used, as suggested on the given link:

    https://www.grapecity.com/documents-api-word/docs/online/conditionally-hide-blocks.html

    Can you please share your word template with some dummy data replicating the issue so that we can replicate the same issue at our end and assist you further accordingly?

    Regards,

    Prabhat Sharma.

  • Posted 6 October 2022, 2:45 am EST - Updated 6 October 2022, 2:51 am EST

    In word, create a table.

    In a cell

    The JSON :

    [code]{

    “Item”:{

    “DataJson”:{

    “DateGeneration”:“04/10/2022”,

    “Immatriculation”:“100000074”,

    “RaisonSociale”:“FREE 1234”,

    “dateDebut”:“04/09/2000”,

    “dateFin”:“04/10/2022”,

    “dateGeneration”:“04/10/2022”,

    “NbCommande”:“1”,

    “MntTotalCommande”:“9,80”,

    “listeCommandes”:{

    “detailCommande”:[

    {

    “NumCommande”:“210002210”,

    “DateCommande”:“14/09/2021”,

    “FactTxtLigne1”:“Ligne1_Free”,

    “FactTxtLigne2”:“Ligne2_Free”,

    “FactTxtLigne3”:“Ligne3_Free”,

    “FactTxtCodePostal”:“75001”,

    “FactTxtLocalite”:“PARIS”,

    “FactTxtPays”:“FRANCE”,

    “LivTxtLigne1”:“1 NEW ADRESSE”,

    “LivTxtLigne2”:“2 NEW ADRESSE”,

    “LivTxtLigne3”:“3 NEW ADRESSE”,

    “LivTxtLigne4”:“4 NEW ADRESSE”,

    “LivTxtLigne5”:“5 NEW ADRESSE”,

    “LivTxtCodePostal”:“75007”,

    “LivTxtLocalite”:“PARIS”,

    “LivTxtPays”:“FRANCE”

               }
    

    ]}}}}[/code]

    Result :

    result with HBI-Empty on ligne 4 or 5 :

    The cell is empty no data.

  • Posted 7 October 2022, 4:11 am EST

    Hello,

    Thank you for reporting this issue. We too can observe the issue and escalate this to the development team for investigation. We will let you know as soon as we get any update on this from their end. [Internal Tracking ID: DOC-4670]

    Regards,

    Prabhat Sharma.

  • Posted 12 October 2022, 2:32 am EST

    Hello Vincent,

    As per the developers, in the cell, the block is a whole row. It’s why hbi-empty works as it is working. As a workaround, you can place them on an invisible table containing a single cell so only this table/cell will be affected.

    Please find the attached modified sample for the same.

    Regards,

    Prabhat Sharma.

    JSON_DataBinding_Mod.zip

  • Posted 12 October 2022, 2:39 am EST

    Hello,

    Thank you for the answer even if the solution is the one I’ve already applied for my test.

    But stil remain the issue of empty line when empty.

    I was hoping a better way to do this.

  • Posted 12 October 2022, 3:04 am EST - Updated 12 October 2022, 3:09 am EST

    Hello Vincent,

    Please confirm if your requirement is the same as shown in the attached image.

    If there is any other requirement then, please please explain your requirements with the help of some screenshots.

    Regards,

    Prabhat Sharma.

  • Posted 16 November 2022, 8:47 am EST

    Yes it is the requirement. If a {{}} is empty so delete it and let the next block to move up.

    So the grey zone must be deleted or something :slight_smile:

  • Posted 17 November 2022, 7:30 am EST

    Hi,

    We are discussing this requirement with the development team. Will get back to you once we have any update from them.

    Regards,

    Nitin

  • Posted 18 November 2022, 7:49 am EST

    Hi,

    This requirement will possible to achieve in new 6.0 release. You have to wait till release.

    ETA for the new 6.0 release is next month.

    Best Regards,

    Nitin

  • Posted 12 January 2023, 7:07 am EST

    Hi,

    This issue is resolved. Now you can use conditional templates to achieve this requirement.

    Please refer the modified attached sample for the same : JSON_DataBinding_Mod2.zip

    Best Regards,

    Nitin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels