I found a solution for this.
my code is:
paramaters.put("fromDate", fromDate);
paramaters.put("toDate", toDate);
if (!output.equals("pdf"))
{
paramaters.put("IS_IGNORE_PAGINATION", true);
}
else
paramaters.put("IS_IGNORE_PAGINATION", false);
JasperPrint jasperPrint = null;
jasperPrint = JasperFillManager.fillReport(CompiledReport,paramaters, connection);
if (output.equals("html")) {
generateHtmlResponse(response, jasperPrint);
} else if (output.equals("pdf")) {
generatePdfResponse(response, jasperPrint);
} else if(output.equals("excel")) {
generateXLResponse(response, jasperPrint);
}
source
share