Skip to main content
kavyan471063
September 10, 2024
Question

Docx from Dynamic template with table of empty data not showing table headers

  • September 10, 2024
  • 3 replies
  • 0 views

Hi All,

  I have a template document where it has 3 statements and then a table which will display data . But if the data is empty, the table header is also not displaying . But I need the output doc to display the template. table with header row showing no data available. Is this possible, Please suggest some solutions.

a!localVariables(
  local!queryXML:  if(
    toboolean(ri!isFormat)=true(),
    ri!data,
    a!forEach(
      items: reject(fn!isnull,{ri!data}),
      expression: 
      ""
    )
  ),
  if(
    a!isNullOrEmpty(ri!data),
    "",
    if(
    toboolean(ri!isSplit)=true(),
    local!queryXML,
  ""&
  ""&ri!product&""&
  ""&rule!DIL_testNewDateFormat(date: ri!dateFrom)&" to "&rule!DIL_testNewDateFormat(date: ri!dateTo)&""&
  ""&ri!type&" listing"&
  if(
    ri!type = "Unblinded",
    "Unblinded Safety Data : Do not share with blinded study personnel",
    ""
  )&
  local!queryXML&
  ""
)
)
)
see attachment/resized-image/__size/640x480/__key/communityserver-discussions-components-files/19/pastedimage1725976361949v1.png

    3 replies

    somasundaram.d
    September 10, 2024

    Yes Its possible, try the following code in your docx template.

    Also you need to change the xml in case you do not have any data for the table

    XML for valid values

    XML for empty values

    This will give you the following results

    or

    .             

    somasundaram.d
    September 15, 2024

    [mention:817bec9e1524451bac42dbc8c66c6a3b:e9ed411860ed4f2ba0265705b8793d05] Did this work?

    somasundaram.d
    September 11, 2024

    Please try this