public final class JasperPrintManager extends Object
After having filled a report, you have the option of viewing it, exporting it to a different format, or (most commonly) printing it.
In JasperReports, you can print reports using this manager class. It contains various methods that
can send entire documents or portions of them to the printer. It also allows people to choose
whether to display the print dialog. one can display the content of a page from a
JasperReports document by generating a java.awt.Image object for it using this
manager class.
| Modifier and Type | Field and Description |
|---|---|
static String |
EXCEPTION_MESSAGE_KEY_NO_AVAILABLE_PRINTER |
static String |
PROPERTY_CHECK_AVAILABLE_PRINTERS
Property whose value is used to check the availability of printers accepting jobs.
|
protected static boolean |
unixSunJDK |
| Modifier and Type | Method and Description |
|---|---|
static JasperPrintManager |
getInstance(JasperReportsContext jasperReportsContext) |
boolean |
print(InputStream inputStream,
boolean withPrintDialog) |
boolean |
print(InputStream inputStream,
int pageIndex,
boolean withPrintDialog) |
boolean |
print(InputStream inputStream,
int firstPageIndex,
int lastPageIndex,
boolean withPrintDialog) |
boolean |
print(JasperPrint jasperPrint,
boolean withPrintDialog) |
boolean |
print(JasperPrint jasperPrint,
int pageIndex,
boolean withPrintDialog) |
boolean |
print(JasperPrint jasperPrint,
int firstPageIndex,
int lastPageIndex,
boolean withPrintDialog) |
boolean |
print(String sourceFileName,
boolean withPrintDialog) |
boolean |
print(String sourceFileName,
int pageIndex,
boolean withPrintDialog) |
boolean |
print(String sourceFileName,
int firstPageIndex,
int lastPageIndex,
boolean withPrintDialog) |
static boolean |
printPage(InputStream inputStream,
int pageIndex,
boolean withPrintDialog) |
static boolean |
printPage(JasperPrint jasperPrint,
int pageIndex,
boolean withPrintDialog) |
static boolean |
printPage(String sourceFileName,
int pageIndex,
boolean withPrintDialog) |
static boolean |
printPages(InputStream inputStream,
int firstPageIndex,
int lastPageIndex,
boolean withPrintDialog) |
static boolean |
printPages(JasperPrint jasperPrint,
int firstPageIndex,
int lastPageIndex,
boolean withPrintDialog) |
static boolean |
printPages(String sourceFileName,
int firstPageIndex,
int lastPageIndex,
boolean withPrintDialog) |
static Image |
printPageToImage(InputStream inputStream,
int pageIndex,
float zoom) |
static Image |
printPageToImage(JasperPrint jasperPrint,
int pageIndex,
float zoom) |
static Image |
printPageToImage(String sourceFileName,
int pageIndex,
float zoom) |
static boolean |
printReport(InputStream inputStream,
boolean withPrintDialog) |
static boolean |
printReport(JasperPrint jasperPrint,
boolean withPrintDialog) |
static boolean |
printReport(String sourceFileName,
boolean withPrintDialog) |
Image |
printToImage(InputStream inputStream,
int pageIndex,
float zoom) |
Image |
printToImage(JasperPrint jasperPrint,
int pageIndex,
float zoom) |
Image |
printToImage(String sourceFileName,
int pageIndex,
float zoom) |
public static final String EXCEPTION_MESSAGE_KEY_NO_AVAILABLE_PRINTER
public static final String PROPERTY_CHECK_AVAILABLE_PRINTERS
true.protected static final boolean unixSunJDK
public static JasperPrintManager getInstance(JasperReportsContext jasperReportsContext)
public boolean print(String sourceFileName, boolean withPrintDialog) throws JRException
JRExceptionpublic boolean print(InputStream inputStream, boolean withPrintDialog) throws JRException
JRExceptionpublic boolean print(JasperPrint jasperPrint, boolean withPrintDialog) throws JRException
JRExceptionpublic boolean print(String sourceFileName, int pageIndex, boolean withPrintDialog) throws JRException
JRExceptionpublic boolean print(InputStream inputStream, int pageIndex, boolean withPrintDialog) throws JRException
JRExceptionpublic boolean print(JasperPrint jasperPrint, int pageIndex, boolean withPrintDialog) throws JRException
JRExceptionpublic boolean print(String sourceFileName, int firstPageIndex, int lastPageIndex, boolean withPrintDialog) throws JRException
JRExceptionpublic boolean print(InputStream inputStream, int firstPageIndex, int lastPageIndex, boolean withPrintDialog) throws JRException
JRExceptionpublic boolean print(JasperPrint jasperPrint, int firstPageIndex, int lastPageIndex, boolean withPrintDialog) throws JRException
JRExceptionpublic Image printToImage(String sourceFileName, int pageIndex, float zoom) throws JRException
JRExceptionpublic Image printToImage(InputStream inputStream, int pageIndex, float zoom) throws JRException
JRExceptionpublic Image printToImage(JasperPrint jasperPrint, int pageIndex, float zoom) throws JRException
JRExceptionpublic static boolean printReport(String sourceFileName, boolean withPrintDialog) throws JRException
JRExceptionprint(String, boolean)public static boolean printReport(InputStream inputStream, boolean withPrintDialog) throws JRException
JRExceptionprint(InputStream, boolean)public static boolean printReport(JasperPrint jasperPrint, boolean withPrintDialog) throws JRException
JRExceptionprint(JasperPrint, boolean)public static boolean printPage(String sourceFileName, int pageIndex, boolean withPrintDialog) throws JRException
JRExceptionprint(String, int, boolean)public static boolean printPage(InputStream inputStream, int pageIndex, boolean withPrintDialog) throws JRException
JRExceptionprint(InputStream, int, boolean)public static boolean printPage(JasperPrint jasperPrint, int pageIndex, boolean withPrintDialog) throws JRException
JRExceptionprint(JasperPrint, int, boolean)public static boolean printPages(String sourceFileName, int firstPageIndex, int lastPageIndex, boolean withPrintDialog) throws JRException
JRExceptionprint(String, int, int, boolean)public static boolean printPages(InputStream inputStream, int firstPageIndex, int lastPageIndex, boolean withPrintDialog) throws JRException
JRExceptionprint(InputStream, int, int, boolean)public static boolean printPages(JasperPrint jasperPrint, int firstPageIndex, int lastPageIndex, boolean withPrintDialog) throws JRException
JRExceptionprint(JasperPrint, int, int, boolean)public static Image printPageToImage(String sourceFileName, int pageIndex, float zoom) throws JRException
JRExceptionprintToImage(String, int, float)public static Image printPageToImage(InputStream inputStream, int pageIndex, float zoom) throws JRException
JRExceptionprintToImage(InputStream, int, float)public static Image printPageToImage(JasperPrint jasperPrint, int pageIndex, float zoom) throws JRException
JRExceptionprintToImage(JasperPrint, int, float)Copyright © 2017. All rights reserved.