diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioImpressaoRmd.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioImpressaoRmd.java index cbc37190d..22aa9f7a8 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioImpressaoRmd.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioImpressaoRmd.java @@ -15,9 +15,11 @@ public class RelatorioImpressaoRmd extends Relatorio { public RelatorioImpressaoRmd(final Map parametros, Connection conexao) throws Exception { super(parametros, conexao); - List list = (List) parametros.get("list"); + this.setCustomXls(true); + List list = (List) parametros.get("list"); this.setCollectionDataSource(new JRBeanCollectionDataSource(list)); + } @Override diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioImpressaoRmdBpr.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioImpressaoRmdBpr.java index d0aa544c0..f40b82b70 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioImpressaoRmdBpr.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioImpressaoRmdBpr.java @@ -15,8 +15,9 @@ public class RelatorioImpressaoRmdBpr extends Relatorio { public RelatorioImpressaoRmdBpr(final Map parametros, Connection conexao) throws Exception { super(parametros, conexao); + this.setCustomXls(true); + List list = (List) parametros.get("list"); - this.setCollectionDataSource(new JRBeanCollectionDataSource(list)); } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioJasper.java b/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioJasper.java index 493e6d479..6df0c102e 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioJasper.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioJasper.java @@ -104,7 +104,7 @@ public class RenderRelatorioJasper { * @see com.rjconsultores.ventaboletos.relatorios.utilitarios.IRenderRelatorio#render() */ - public byte[] render(SaidaRelatorio saida) throws Exception { + public byte[] render(SaidaRelatorio saida, boolean isCustomXls) throws Exception { this.preRender(); byte[] conteudo = null; @@ -128,7 +128,7 @@ public class RenderRelatorioJasper { break; case XLS: - conteudo = this.renderXls(); + conteudo = this.renderXls(isCustomXls); break; } @@ -136,28 +136,27 @@ public class RenderRelatorioJasper { return conteudo; } - protected byte[] renderXls() throws Exception { - + protected byte[] renderXls(boolean isCustomXls) throws Exception { JExcelApiExporter exporterXLS = new JExcelApiExporter(); ByteArrayOutputStream output = new ByteArrayOutputStream(); exporterXLS.setParameter(JExcelApiExporterParameter.JASPER_PRINT, this.jasperPrint); exporterXLS.setParameter(JExcelApiExporterParameter.OUTPUT_STREAM, output); - exporterXLS.setParameter(JExcelApiExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); - exporterXLS.setParameter(JExcelApiExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE); - exporterXLS.setParameter(JExcelApiExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE); - exporterXLS.setParameter(JExcelApiExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE); + + if (!isCustomXls) { + exporterXLS.setParameter(JExcelApiExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); + exporterXLS.setParameter(JExcelApiExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE); + exporterXLS.setParameter(JExcelApiExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE); + exporterXLS.setParameter(JExcelApiExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE); + } // collapseRowSpan // JRXlsExporterParameter. exporterXLS.exportReport(); return output.toByteArray(); - } protected byte[] renderPdf() throws Exception { - return JasperExportManager.exportReportToPdf(this.jasperPrint); - } } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmd.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmd.jasper index 45f9d0dd6..c08a16dc1 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmd.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmd.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmd.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmd.jrxml index 67bc98e8f..f5e617f9c 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmd.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmd.jrxml @@ -1,6 +1,6 @@ - - + + @@ -43,35 +43,35 @@ - + - + - + - + - + @@ -170,7 +170,7 @@ - + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmdBpr.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmdBpr.jasper index b84767cdd..d6faa8c42 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmdBpr.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmdBpr.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmdBpr.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmdBpr.jrxml index 924bd5c0b..83b940342 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmdBpr.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRmdBpr.jrxml @@ -1,7 +1,7 @@ - - - + + + @@ -43,35 +43,35 @@ - + - + - + - + - + - + - + - + @@ -124,7 +124,7 @@ - + @@ -173,37 +173,37 @@ - + - + - + - + - + - + - + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java index c7304dd83..1e758311b 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java @@ -1,6 +1,5 @@ package com.rjconsultores.ventaboletos.relatorios.utilitarios; -import java.net.URL; import java.sql.Connection; import java.util.HashSet; import java.util.Map; @@ -30,6 +29,7 @@ public abstract class Relatorio { private JRBeanCollectionDataSource collectionDataSource; private String[] nomeSubReporte; private String baseDir; + protected Boolean customXls; protected Relatorio(Map parametros, Connection conexao) { this.parametros = parametros; @@ -121,7 +121,7 @@ public abstract class Relatorio { this.render = new RenderRelatorioJasper(this); } - conteudo = this.render.render(saida); + conteudo = this.render.render(saida, (customXls == null ? false : customXls)); } catch (Exception e) { throw e; @@ -169,4 +169,11 @@ public abstract class Relatorio { this.baseDir = baseDir; } + public Boolean isCustomXls() { + return customXls; + } + + public void setCustomXls(Boolean customXls) { + this.customXls = customXls; + } } \ No newline at end of file diff --git a/web/gui/gr/editarAidf.zul b/web/gui/gr/editarAidf.zul index 69dcc6095..6a1ebaf57 100644 --- a/web/gui/gr/editarAidf.zul +++ b/web/gui/gr/editarAidf.zul @@ -60,7 +60,7 @@