Skip to main content
rishukumarg1965
April 24, 2025
Question

Building Table in DOCX with N number of ROW'S

  • April 24, 2025
  • 2 replies
  • 0 views

I need to create a dynamic DOCX document that includes a table with 11 columns, where each column should automatically adjusts its width.

I have attached a code snippet that generates a DOCX document with a table showing only 8 columns. The remaining 3 columns exceed the page width, so they aren't visible.

Please help me to fix it.

 

", a!forEach( items: local!selectedEquipments, expression: concat( "", "", "", "", "", "", "", "", "", "", "", "", "" ) ), "
SAP Number Part Number Description Manufacturer Group Spare Qty Delivery Date Price Total Remarks
" & fv!item.sapnumber & "" & fv!item.partnumber & "" & fv!item.description & "" & if( a!isNotNullOrEmpty(fv!item.manufacturer), fv!item.manufacturer, "--" ) & "" & fv!item.group & "" & if(fv!item.spare, "Yes", "No") & "" & fv!item.qty & "" & text( todate(fv!item.deliverydate), "yyyy/mm/dd" ) & "" & a!currency(isoCode: "USD", value: fv!item.cadprice) & "" & a!currency(isoCode: "USD", value: fv!item.pricetotal) & "" & if( a!isNotNullOrEmpty(fv!item.remarks), fv!item.remarks, "--" ) & "


", ) ) ) ), "
",

2 replies

July 18, 2025

Hi [mention:c7ed152842da4892ba88b9d946100b8f:e9ed411860ed4f2ba0265705b8793d05] , 

Can you try adding the below mentioned line to your code and let me know if that works ?
I was facing a similar issue and it worked for me. I hope it work for you

 

  

shubhama926776
July 19, 2025

I've adjusted the column widths to fit all 11 columns on the page - gave more space to Description and Remarks since they usually have more text, and squeezed the smaller ones like Qty and Spare. Should work now

", a!forEach( items: local!selectedEquipments, expression: concat( "", "", "", "", "", "", "", "", "", "", "", "", "" ) ), "
SAP Number Part Number Description Manufacturer Group Spare Qty Delivery Date Price Total Remarks
" & fv!item.sapnumber & "" & fv!item.partnumber & "" & fv!item.description & "" & if( a!isNotNullOrEmpty(fv!item.manufacturer), fv!item.manufacturer, "--" ) & "" & fv!item.group & "" & if(fv!item.spare, "Yes", "No") & "" & fv!item.qty & "" & text( todate(fv!item.deliverydate), "dd/mm/yy" ) & "" & a!currency(isoCode: "USD", value: fv!item.cadprice) & "" & a!currency(isoCode: "USD", value: fv!item.pricetotal) & "" & if( a!isNotNullOrEmpty(fv!item.remarks), fv!item.remarks, "--" ) & "


", ) ) ) ), "
",