edgar 2016-12-12 19:35:41 +00:00
parent 287fb7d3cf
commit 4f5e75dbf7
4 changed files with 15 additions and 4 deletions

View File

@ -1,10 +1,15 @@
package com.rjconsultores.ventaboletos.relatorios.impl; package com.rjconsultores.ventaboletos.relatorios.impl;
import java.io.File;
import java.net.URL;
import java.sql.Connection; import java.sql.Connection;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.ResourceBundle;
import javax.faces.context.FacesContext;
import com.rjconsultores.ventaboletos.entidad.Tramo; import com.rjconsultores.ventaboletos.entidad.Tramo;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource; import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource;
@ -18,6 +23,10 @@ public class RelatorioTabelaPreco extends Relatorio {
super(parametros, conexao); super(parametros, conexao);
this.isLayoutArtesp = (Boolean) parametros.get("isLayoutArtesp"); this.isLayoutArtesp = (Boolean) parametros.get("isLayoutArtesp");
if (isLayoutArtesp) {
URL url = getClass().getResource("/com/rjconsultores/ventaboletos/relatorios/imagens/artesp.png");
parametros.put("artesp_logo", url.getPath());
}
this.setCustomDataSource(new ArrayDataSource(this) { this.setCustomDataSource(new ArrayDataSource(this) {
public void initDados() throws Exception { public void initDados() throws Exception {

View File

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioTabelaPreco" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="5edc9f7a-8634-485f-96f7-c65a462aa868"> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioTabelaPreco" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="5edc9f7a-8634-485f-96f7-c65a462aa868">
<property name="ireport.zoom" value="1.4641000000000033"/> <property name="ireport.zoom" value="1.1000000000000025"/>
<property name="ireport.x" value="0"/> <property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/> <property name="ireport.y" value="0"/>
<parameter name="artesp_logo" class="java.lang.String"/>
<field name="origem" class="java.lang.String"/> <field name="origem" class="java.lang.String"/>
<field name="destino" class="java.lang.String"/> <field name="destino" class="java.lang.String"/>
<field name="tarifa" class="java.math.BigDecimal"/> <field name="tarifa" class="java.math.BigDecimal"/>
@ -286,8 +287,8 @@
<textFieldExpression><![CDATA[$R{label.msgAviso}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.msgAviso}]]></textFieldExpression>
</textField> </textField>
<image onErrorType="Blank"> <image onErrorType="Blank">
<reportElement uuid="a81f07bd-df73-4d40-a1bc-6593b855ecb0" x="0" y="15" width="172" height="29"/> <reportElement uuid="c430d4fa-0d54-4292-82b9-b8ea5b1a9aac" x="0" y="15" width="172" height="28"/>
<imageExpression><![CDATA["/imagens/artesp.png"]]></imageExpression> <imageExpression><![CDATA[$P{artesp_logo}]]></imageExpression>
</image> </image>
</band> </band>
</pageFooter> </pageFooter>

View File

@ -1,5 +1,6 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios; package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;