}
PrintRequestAttributeSet printRequestAttributeSet = null;
if(displayPrintDialogOnlyOnce || displayPageDialogOnlyOnce)
{
printRequestAttributeSet = new HashPrintRequestAttributeSet();
setDefaultPrintRequestAttributeSet(printRequestAttributeSet);
setOrientation((JasperPrint)jasperPrintList.get(0), printRequestAttributeSet);
if(displayPageDialogOnlyOnce)
{
if(printerJob.pageDialog(printRequestAttributeSet) == null)
{
return;
}
else
{
displayPageDialog = false;
}
}
if(displayPrintDialogOnlyOnce)
{
if(!printerJob.printDialog(printRequestAttributeSet))
{
printStatus = new Boolean[]{Boolean.FALSE};
return;
}
else
{
displayPrintDialog = false;
}
}
}
List status = new ArrayList();
// fix for bug ID artf1455 from jasperforge.org bug database
for(reportIndex = 0; reportIndex < jasperPrintList.size(); reportIndex++)
{
setJasperPrint((JasperPrint)jasperPrintList.get(reportIndex));
exporter = new JRGraphics2DExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.PROGRESS_MONITOR, parameters.get(JRExporterParameter.PROGRESS_MONITOR));
exporter.setParameter(JRExporterParameter.OFFSET_X, parameters.get(JRExporterParameter.OFFSET_X));
exporter.setParameter(JRExporterParameter.OFFSET_Y, parameters.get(JRExporterParameter.OFFSET_Y));
exporter.setParameter(JRGraphics2DExporterParameter.ZOOM_RATIO, parameters.get(JRGraphics2DExporterParameter.ZOOM_RATIO));
exporter.setParameter(JRExporterParameter.CLASS_LOADER, classLoader);
exporter.setParameter(JRExporterParameter.URL_HANDLER_FACTORY, urlHandlerFactory);
exporter.setParameter(JRExporterParameter.FILE_RESOLVER, fileResolver);
if (parameters.containsKey(JRExporterParameter.FILTER))
{
exporter.setParameter(JRExporterParameter.FILTER, filter);
}
exporter.setParameter(JRGraphics2DExporterParameter.MINIMIZE_PRINTER_JOB_SIZE, parameters.get(JRGraphics2DExporterParameter.MINIMIZE_PRINTER_JOB_SIZE));
if(displayPrintDialog || displayPageDialog ||
(!displayPrintDialogOnlyOnce && !displayPageDialogOnlyOnce))
{
printRequestAttributeSet = new HashPrintRequestAttributeSet();
setDefaultPrintRequestAttributeSet(printRequestAttributeSet);
setOrientation(jasperPrint, printRequestAttributeSet);
}
try