IDEMPIERE-2682 Html Report >> locking/freeze header row (#761)

* IDEMPIERE-2682 Html Report >> locking/freeze header row

Fix printing
This commit is contained in:
hengsin 2021-07-06 02:24:42 +08:00 committed by GitHub
parent a74694f81e
commit d7c0ebf980
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 2 deletions

View File

@ -742,7 +742,11 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
doc.output(w);
w.println("<div class='"+cssPrefix+"-flex-container'>");
String paraWrapId = null;
if (parameterTable != null) {
paraWrapId = cssPrefix + "-para-table-wrap";
w.println("<div id='" + paraWrapId + "'>");
parameterTable.output(w);
tr tr = new tr();
@ -781,8 +785,19 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
w.println();
w.println("</table>");
w.println("</div>");
}
StringBuilder tableWrapDiv = new StringBuilder();
tableWrapDiv.append("<div class='").append(cssPrefix).append("-table-wrap' ");
if (paraWrapId != null) {
tableWrapDiv.append("onscroll=\"if (this.scrollTop > 0) document.getElementById('")
.append(paraWrapId).append("').style.display='none'; ")
.append("else document.getElementById('").append(paraWrapId).append("').style.display='block';\"");
}
tableWrapDiv.append(" >");
w.println(tableWrapDiv.toString());
table.output(w);
}
@ -992,6 +1007,8 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
}
if (!onlyTable)
{
w.println("</div>");
w.println("</div>");
w.println("</body>");
w.println("</html>");
}

View File

@ -5,7 +5,8 @@
border-width: 1px;
border-color: #BBBBBB;
border-style: solid;
border-collapse: collapse;
border-collapse: separate;
border-spacing: 0;
width: 90%;
background-color: #EBF1EF;
border-width: 0px;
@ -68,3 +69,34 @@
border-width: 0px 0px 0px 0px;
}
div.rp-flex-container {
display: flex;
flex-direction: column;
height: 100%;
}
#rp-para-table-wrap {
flex-grow: 0;
}
div.rp-table-wrap {
flex-grow: 1;
overflow: auto;
}
div.rp-table-wrap > table > thead > tr > th {
position: sticky;
top: 0;
}
@media print {
div.rp-flex-container {
height: auto;
}
div.rp-table-wrap {
overflow: visible;
}
div.rp-table-wrap > table > thead > tr > th {
position: relative;
}
}