Search in sources :

Example 1 with PrintPageFormat

use of net.sf.jasperreports.engine.PrintPageFormat in project jgnash by ccavanaugh.

the class JasperViewerDialogController method handleFitHeightAction.

@FXML
private void handleFitHeightAction() {
    final PrintPageFormat pageFormat = jasperPrint.get().getPageFormat(pageIndex.get());
    final double heightRatio = (scrollPane.getViewportBounds().getHeight() - (2 * PAGE_BORDER)) / pageFormat.getPageHeight();
    final double widthRatio = (scrollPane.getViewportBounds().getWidth() - (2 * PAGE_BORDER)) / pageFormat.getPageWidth();
    zoomComboBox.getSelectionModel().clearSelection();
    setActualZoomRatio(heightRatio < widthRatio ? heightRatio : widthRatio);
}
Also used : PrintPageFormat(net.sf.jasperreports.engine.PrintPageFormat) FXML(javafx.fxml.FXML) InjectFXML(jgnash.uifx.util.InjectFXML)

Aggregations

FXML (javafx.fxml.FXML)1 InjectFXML (jgnash.uifx.util.InjectFXML)1 PrintPageFormat (net.sf.jasperreports.engine.PrintPageFormat)1