Skip to content

Commit

Permalink
take care of "new page" for printing reason
Browse files Browse the repository at this point in the history
  • Loading branch information
dpmihai committed Sep 7, 2015
1 parent aa54f49 commit 78f5198
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/ro/nextreports/engine/exporter/HtmlExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,27 @@ private String getStringValue(Object val, String pattern) {
return v;
}

// even if HTML is not a paged document we need to take care for print page breaks "page-break-before: always"
// tables need to be broken in order to force a page break.
protected void newPage() {
if (!bean.isSubreport()) {
try {
stream.print("</table>\n");
stream.println("<p style=\"page-break-before: always\"></p>\n");
if (bean.getReportLayout().isUseSize()) {
stream.print("<table>");
} else {
stream.print("<table style='width:100%'>");
}
if (bean.getReportLayout().isHeaderOnEveryPage()) {
printHeaderBand();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

// private String getRotationStyle(short angle) {
// StringBuilder sb = new StringBuilder();
// if (angle == -90) {
Expand Down

0 comments on commit 78f5198

Please sign in to comment.