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 breakany 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" }, " <html> <body> <table id='notes'> <thead> "&if(a!isNullOrEmpty(local!requestAuditLog),"No Notes avaliable for this request", "<tr style='background-color:#c0e4dc'> <th colspan='4'><b>AR Notes</b></th> </tr> <tr style='background-color:#A1A0D3'> <th>" & local!tableHeadings[1] & "</th> <th>" & local!tableHeadings[2] & "</th> <th>" & local!tableHeadings[3] & "</th> <th>" & local!tableHeadings[4] & "</th> </tr> </thead> <tbody> "&a!localVariables( local!rows: a!forEach( items: local!requestAuditLog, expression: "<tr style='height:auto;width:100%;font-size: 10px;padding:0'> <td style='width:100px;padding:0'>" & text(index(fv!item,"createdDate",{}),"dd/mm/yyyy") & "</td> <td style='width:100px;padding:0'>" & rule!EPR_DisplayFullUserName( index(fv!item,"createdBy",{})) & "</td> <td style='width:100px;padding:0'>" & index(fv!item,"action",{}) & "</td> <td style='width:auto;height:auto;'>" & index(fv!item,"comment",{}) & "</td> </tr>" ), local!rowsWithPageBreaks: a!forEach( items: local!rows, expression: a!localVariables( fv!item & if( mod(fv!index, 2) <> 0, "", if(fv!itemCount=fv!index,"", "</tbody></table><p class='page-break'></p>" & "<div style='page-break-before: always;'> <div class = 'header-rule'> "& rule!EPR_HTMLTemplate_SectionHeader()& " </div> " & rule!EPR_CMPT_GeneralInformation(requestId: ri!requestId) & " </div><table id = 'notes'><tbody>" )) ) ), joinarray(local!rowsWithPageBreaks, "") ) &" </tbody>")&" </table> </body> </html>" )
Discussion posts and replies are publicly visible
What do you try to do with this HTML code? Turn it into PDF?
Yes Stefan Helzle ,I was working on conversion from html to pdf
OK. Has described in my blog post, the solution to this is, to let HTML + CSS do the magic.
appian.rocks/.../
I added notes data, intending to display 2 rows per page. However, when the content of the "Notes" data is minimal, it leaves an empty space on the page. How can I remove this empty space and adjust the number of rows per page accordingly?