Commit 2bce1a1cc25ab77143b5afa38754ede2d448fb2a
1 parent
bdd2d1c9
Exists in
master
Redimine #tarefa-3815
Showing
2 changed files
with
10 additions
and
6 deletions
Show diff stats
cit-core/src/main/java/br/com/centralit/framework/controller/ReportController.java
... | ... | @@ -54,4 +54,7 @@ public interface ReportController { |
54 | 54 | * */ |
55 | 55 | public abstract void gerarRelatorio(boolean download, String type, JasperPrint jasperPrint, HttpServletResponse response, |
56 | 56 | ByteArrayOutputStream baos, String reportName); |
57 | + | |
58 | + public abstract void gerarRelatorio(boolean download, String type, JasperPrint jasperPrint, HttpServletResponse response, | |
59 | + ByteArrayOutputStream baos, String reportName,boolean isVazio); | |
57 | 60 | } |
58 | 61 | \ No newline at end of file | ... | ... |
cit-core/src/main/java/br/com/centralit/framework/controller/ReportControllerImpl.java
... | ... | @@ -239,8 +239,12 @@ public class ReportControllerImpl implements ReportController { |
239 | 239 | * */ |
240 | 240 | @Override |
241 | 241 | public void gerarRelatorio (boolean download, String type, JasperPrint jasperPrint, HttpServletResponse response, ByteArrayOutputStream baos, String reportName){ |
242 | + gerarRelatorio(download, type, jasperPrint, response, baos, reportName, verificarRelatorioVazio(jasperPrint)); | |
243 | + } | |
244 | + | |
245 | + public void gerarRelatorio (boolean download, String type, JasperPrint jasperPrint, HttpServletResponse response, ByteArrayOutputStream baos, String reportName, boolean isVazio){ | |
242 | 246 | |
243 | - if(verificarRelatorioVazio(jasperPrint)){ | |
247 | + if(isVazio) { | |
244 | 248 | |
245 | 249 | // Create an output byte stream where data will be written |
246 | 250 | baos = new ByteArrayOutputStream(); |
... | ... | @@ -251,10 +255,7 @@ public class ReportControllerImpl implements ReportController { |
251 | 255 | // Write to reponse stream |
252 | 256 | this.write(response, baos); |
253 | 257 | |
254 | - } else { | |
255 | - | |
256 | - response.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED); | |
257 | - | |
258 | - } | |
258 | + } else | |
259 | + response.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED); | |
259 | 260 | } |
260 | 261 | } | ... | ... |