Skip to main content
August 21, 2024
Question

For each request, we have an audit history that I'm displaying as tabular data with 2 rows per page. However, this creates an issue: if I show only 2 rows per page, the remaining space on the page looks empty. On the other hand, if I display 3 ro

  • August 21, 2024
  • 5 replies
  • 0 views

For each request, we have an audit history that I'm displaying as tabular data with 2 rows per page. However, this creates an issue: if I show only 2 rows per page, the remaining space on the page looks empty. On the other hand, if I display 3 rows per page, it doesn’t fit well if any row contains a large amount of data.
Below I have attached reference code for this:


Note:We have to display header and general info after page break
any Alternatives for this,

a!localVariables(
  local!requestAuditLog:rule!EPR_QE_V_getRequestAuditLog(requestId:ri!requestId,actionNotIn: cons!EPR_ACTION_LIST[1]),
  local!tableHeadings: {
    "Date",
    "User Name",
    "Action Taken",
    "Note"
  },
  
  "




"&if(a!isNullOrEmpty(local!requestAuditLog),"No Notes avaliable for this request",
"
"&a!localVariables(
  local!rows: 
    a!forEach(
    items: local!requestAuditLog,
    expression: ""
  ),
  local!rowsWithPageBreaks: a!forEach(
    items: local!rows,
    expression: a!localVariables(
      fv!item & if(
        mod(fv!index, 2) <> 0, "", 
        if(fv!itemCount=fv!index,"",
        "
AR Notes
" & local!tableHeadings[1] & " " & local!tableHeadings[2] & " " & local!tableHeadings[3] & " " & local!tableHeadings[4] & "
" & text(index(fv!item,"createdDate",{}),"dd/mm/yyyy") & " " & rule!EPR_DisplayFullUserName( index(fv!item,"createdBy",{})) & " " & index(fv!item,"action",{}) & " " & index(fv!item,"comment",{}) & "

" & "
"& rule!EPR_HTMLTemplate_SectionHeader()& "
" & rule!EPR_CMPT_GeneralInformation(requestId: ri!requestId) & "
" )) ) ), joinarray(local!rowsWithPageBreaks, "") ) &" ")&"
" )

    5 replies

    stefanhelzle0001
    Brainy
    August 21, 2024

    What do you try to do with this HTML code? Turn it into PDF?

    August 21, 2024

    Yes [mention:a11f77a729fb4db2af76b09948583328:e9ed411860ed4f2ba0265705b8793d05] ,I was working on conversion from html to pdf

    stefanhelzle0001
    Brainy
    August 21, 2024

    OK. Has described in my blog post, the solution to this is, to let HTML + CSS do the magic.

    appian.rocks/.../