docxTable Nested Table



  • How can we display the nested table in Docx template? It should display the parent row and its child rows.


  • administrators

    hi @Sagar-Shinde i'm not sure about the problem you are trying to describe, can you please show what you are currently trying? and also show what should be the expected result?



  • @bjrmatos Inside the table row in want to show child rows. E.g. If Suppose, I want to show the order list. A single order may have multiple items. In the parent row, I want to show basic order details and in a child row, I would like to show the list of items in that respective order.
    Also, Let me know, how can I use the IF condition? If the order has the items then only I would like to show items in child rows otherwise not.

    I hope you understand the scenario.

    Let me know if you need more information.


  • administrators

    @Sagar-Shinde thanks i understand now what you want to achieve, do you have some .docx file with the content that you want to produce? I just want to verify how the final table looks like in reality for your case with the rows and child rows, just to be clear if there is not a limitation to produce the same content. if you have that .docx file then place attach here.

    PD: you can find some instructions here to know how to upload files.



  • 0_1610180704210_Screenshot 2021-01-09 at 1.52.55 PM.png
    I need output like the screenshot attached. The inner table should be conditional. I.e. If an order has items then only it should be displayed, otherwise not.
    I hope you understand now.


  • administrators

    @Sagar-Shinde the layout you show in the screenshot does not look like a real nested table, because a real table would be put just inside a single cell, or at least that is what I know so far, if you really know how to create a table inside a table that looks like your screenshot, then please share the steps to create such layout.

    your layout looks more like the cells were styled to look like another table. if that is what you want to achieve, then you can create a table like that using the dynamic-columns, here is a basic example of that works, there you can put some conditions to achieve what you want, see the docs here.
    the only issue you will find to achieve your layout exactly is related to the merged cells
    0_1610387801236_Captura de pantalla 2021-01-11 a la(s) 12.56.10 p. m..png
    because currently, we don't have a way to create a merged cell dynamically



  • @bjrmatos Thanks for your explanation. I hope you understood, why I used the "Nested table" term for this layout?
    If you can show me the example to render another table within the table cell with the condition then it will work for me.

    Note: The screenshot uploaded above was rendered using jsreport itself without using the dynamic columns feature. I am just facing an issue with the condition. If you can provide me an example to render a table within the cell or merged cell, then it will be great for me.


  • administrators

    @Sagar-Shinde i see, ok. i think it will be much faster if we work around the template you are using and try to resolve the issue you have with the condition, you can share with me an export zip with the template and the resources it uses. if you worried about exposing the template to the public here on the forum then you can also send it to me via email at bjrmatos@gmail.com


Log in to reply
 

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