exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRGraphics2DExporterParameter.GRAPHICS_2D, graphics2D);
for (int pageIndex = 0; pageIndex < numPages; pageIndex++) {
exporter.setParameter(JRExporterParameter.PAGE_INDEX, pageIndex);
exporter.exportReport();
graphics2D.setColor(Color.black);
graphics2D.drawLine(0, pageHeightOnImage, pageWidthOnImage, pageHeightOnImage);
graphics2D.translate(0, pageHeightOnImage);
}
} finally {