fixes bug #10062
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@76887 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
3d3b84ddc7
commit
a8bf2a28d7
|
@ -0,0 +1,145 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.relatorios.impl;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
|
||||
|
||||
public class RelatorioDemandasDetalhadoNovoLayout extends RelatorioDemandas {
|
||||
public RelatorioDemandasDetalhadoNovoLayout(Map<String, Object> parametros, Connection conexao) throws Exception {
|
||||
super(parametros, conexao);
|
||||
this.setCustomDataSource(new ArrayDataSource(this) {
|
||||
@Override
|
||||
public void initDados() throws Exception {
|
||||
Connection conexao = this.relatorio.getConexao();
|
||||
Map<String, Object> parametros = this.relatorio.getParametros();
|
||||
|
||||
Calendar dataInicial = Calendar.getInstance();
|
||||
dataInicial.setTime((Date) parametros.get("DATA_INICIAL"));
|
||||
|
||||
Calendar dataFinal = Calendar.getInstance();
|
||||
dataFinal.setTime((Date) parametros.get("DATA_FINAL"));
|
||||
|
||||
Calendar horaInicial = Calendar.getInstance();
|
||||
if (parametros.get("HORA_INICIAL") != null)
|
||||
horaInicial.setTime((Date) parametros.get("HORA_INICIAL"));
|
||||
|
||||
Calendar horaFinal = Calendar.getInstance();
|
||||
if (parametros.get("HORA_FINAL") != null)
|
||||
horaFinal.setTime((Date) parametros.get("HORA_FINAL"));
|
||||
|
||||
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("select ");
|
||||
sql.append(" trunc(co.feccorrida) as data_corrida, ");
|
||||
sql.append(" trunc(bo.fechorviaje) as data, ");
|
||||
sql.append(" r.descruta as linha, ");
|
||||
sql.append(" r.numruta as codlinha, ");
|
||||
sql.append(" co.corrida_id as servico, ");
|
||||
sql.append(" case when ((ori.indvisibleinternet is null or ori.indvisibleinternet = 1) ");
|
||||
sql.append(" and (des.indvisibleinternet is null or des.indvisibleinternet = 1)) then 'SIM' else 'NÃO' end as internet, ");
|
||||
sql.append(" bo.fechorviaje as horario, ");
|
||||
sql.append(" ori.descparada as origem, ");
|
||||
sql.append(" des.descparada as destino, ");
|
||||
sql.append(" cs.descclase as classe, ");
|
||||
sql.append(" da.cantasientos as capacidade, ");
|
||||
sql.append(" count(bo.boleto_id) as ocupacao, ");
|
||||
sql.append(" ts.descservicio as tipo_servico, ");
|
||||
sql.append(" ct.plataforma as plataforma, ");
|
||||
sql.append(" e.nombempresa as empresa ");
|
||||
sql.append("from boleto bo ");
|
||||
sql.append(" join corrida co on co.corrida_id = bo.corrida_id and co.feccorrida = bo.feccorrida ");
|
||||
sql.append(" join corrida_tramo ct on ct.corrida_id = bo.corrida_id and bo.feccorrida = ct.feccorrida and ct.origen_id = bo.origen_id ");
|
||||
sql.append(" join ruta r on co.ruta_id = r.ruta_id ");
|
||||
sql.append(" left join empresa e on e.empresa_id = bo.empresacorrida_id ");
|
||||
sql.append(" join parada ori on ori.parada_id = bo.origen_id ");
|
||||
sql.append(" join parada des on des.parada_id = bo.destino_id ");
|
||||
sql.append(" join clase_servicio cs on cs.claseservicio_id = co.claseservicio_id ");
|
||||
sql.append(" join rol_operativo ro on ro.roloperativo_id = co.roloperativo_id ");
|
||||
sql.append(" join diagrama_autobus da on ro.diagramaautobus_id = da.diagramaautobus_id ");
|
||||
sql.append(" join tipo_servicio ts on ts.tiposervicio_id = co.tiposervicio_id ");
|
||||
sql.append("where ct.activo = 1 ");
|
||||
sql.append(" and bo.motivocancelacion_id is null and bo.numasiento is not null and bo.indstatusoperacion = 'F' ");
|
||||
sql.append(" and bo.fechorviaje >= :DATA_INICIAL and bo.fechorviaje <= :DATA_FINAL ");
|
||||
sql.append((parametros.get("RUTA_ID") != null) ? " and r.ruta_id = :RUTA_ID " : "");
|
||||
sql.append((parametros.get("EMPRESA_ID") != null) ? " and e.empresa_id = :EMPRESA_ID " : "");
|
||||
sql.append((parametros.get("PARADA_ID") != null) ? " and bo.origen_id = :PARADA_ID " : "");
|
||||
sql.append((parametros.get("TIPO_SERVICO") != null) ? " and ts.tiposervicio_id = :TIPO_SERVICO " : "");
|
||||
|
||||
if (parametros.get("HORA_INICIAL") != null && parametros.get("HORA_FINAL") != null) {
|
||||
sql.append(" AND ");
|
||||
sql.append(" ( ");
|
||||
do {
|
||||
mesclarDataHora(dataInicial, horaInicial);
|
||||
sql.append(" bo.fechorviaje between to_date('" + format.format(dataInicial.getTime()) + "', 'dd/MM/yyyy HH24:MI:ss') ");
|
||||
mesclarDataHora(dataInicial, horaFinal);
|
||||
sql.append(" and to_date('" + format.format(dataInicial.getTime()) + "', 'dd/MM/yyyy HH24:MI:ss')");
|
||||
dataInicial.add(Calendar.DAY_OF_MONTH, 1);
|
||||
if (!dataInicial.after(dataFinal)) {
|
||||
sql.append(" or ");
|
||||
}
|
||||
|
||||
} while (!dataInicial.after(dataFinal));
|
||||
sql.append(" ) ");
|
||||
}
|
||||
|
||||
sql.append("group by trunc(co.feccorrida), trunc(bo.fechorviaje), r.descruta, r.numruta, co.corrida_id, ");
|
||||
sql.append(" case when ((ori.indvisibleinternet is null or ori.indvisibleinternet = 1) ");
|
||||
sql.append(" and (des.indvisibleinternet is null or des.indvisibleinternet = 1)) then 'SIM' else 'NÃO' end, ");
|
||||
sql.append(" bo.fechorviaje, ori.descparada, des.descparada, cs.descclase, ");
|
||||
sql.append(" da.cantasientos, ts.descservicio, ct.plataforma, e.nombempresa ");
|
||||
sql.append("order by e.nombempresa, data, linha, servico, origem, destino ");
|
||||
|
||||
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql.toString());
|
||||
if (parametros.get("EMPRESA_ID") != null)
|
||||
stmt.setInt("EMPRESA_ID", Integer.valueOf(parametros.get("EMPRESA_ID").toString()));
|
||||
|
||||
if (parametros.get("PARADA_ID") != null)
|
||||
stmt.setInt("PARADA_ID", Integer.valueOf(parametros.get("PARADA_ID").toString()));
|
||||
|
||||
if (parametros.get("RUTA_ID") != null)
|
||||
stmt.setInt("RUTA_ID", Integer.valueOf(parametros.get("RUTA_ID").toString()));
|
||||
|
||||
if (parametros.get("TIPO_SERVICO") != null)
|
||||
stmt.setInt("TIPO_SERVICO", Integer.valueOf(parametros.get("TIPO_SERVICO").toString()));
|
||||
|
||||
stmt.setTimestamp("DATA_INICIAL", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime()));
|
||||
stmt.setTimestamp("DATA_FINAL", new Timestamp(DateUtil.fimFecha((Date) parametros.get("DATA_FINAL")).getTime()));
|
||||
|
||||
ResultSet rset = stmt.executeQuery();
|
||||
while (rset.next()) {
|
||||
Map<String, Object> dataResult = new HashMap<String, Object>();
|
||||
dataResult.put("DATA", rset.getDate("DATA"));
|
||||
dataResult.put("LINHA", rset.getString("LINHA"));
|
||||
dataResult.put("SERVICO", rset.getBigDecimal("SERVICO"));
|
||||
dataResult.put("INTERNET", rset.getString("INTERNET"));
|
||||
dataResult.put("HORARIO", rset.getTimestamp("HORARIO"));
|
||||
dataResult.put("ORIGEM", rset.getString("ORIGEM"));
|
||||
dataResult.put("DESTINO", rset.getString("DESTINO"));
|
||||
dataResult.put("CLASSE", rset.getString("CLASSE"));
|
||||
dataResult.put("CAPACIDADE", rset.getInt("CAPACIDADE"));
|
||||
dataResult.put("TIPO_SERVICO", rset.getString("TIPO_SERVICO"));
|
||||
dataResult.put("PLATAFORMA", rset.getString("PLATAFORMA"));
|
||||
dataResult.put("OCUPACAO", rset.getInt("OCUPACAO"));
|
||||
dataResult.put("EMPRESA", rset.getString("EMPRESA"));
|
||||
dataResult.put("CODLINHA", rset.getString("CODLINHA"));
|
||||
this.dados.add(dataResult);
|
||||
}
|
||||
this.resultSet = rset;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
#geral
|
||||
msg.noData=Não foi possivel obter dados com os parâmetros informados.
|
||||
|
||||
|
||||
#Labels cabeçalho
|
||||
cabecalho.relatorio=Relatório:
|
||||
cabecalho.periodo=Período:
|
||||
cabecalho.periodoA=à
|
||||
cabecalho.dataHora=Data/Hora:
|
||||
cabecalho.impressorPor=Impressor por:
|
||||
cabecalho.pagina=Página
|
||||
cabecalho.de=de
|
||||
cabecalho.filtros=Filtros:
|
Binary file not shown.
|
@ -0,0 +1,265 @@
|
|||
<?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="RelatorioDemandasDetalhadoNovoLayout" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="842" leftMargin="0" rightMargin="0" topMargin="20" bottomMargin="20" uuid="b92fb063-a827-4619-8a69-5c78e3afbb8c">
|
||||
<property name="ireport.zoom" value="3.2210200000000144"/>
|
||||
<property name="ireport.x" value="556"/>
|
||||
<property name="ireport.y" value="0"/>
|
||||
<style name="textStyle" isDefault="true" fontSize="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
|
||||
<style name="table">
|
||||
<box>
|
||||
<pen lineWidth="1.0" lineColor="#000000"/>
|
||||
</box>
|
||||
</style>
|
||||
<style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
|
||||
<box>
|
||||
<pen lineWidth="0.5" lineColor="#000000"/>
|
||||
</box>
|
||||
</style>
|
||||
<style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
|
||||
<box>
|
||||
<pen lineWidth="0.5" lineColor="#000000"/>
|
||||
</box>
|
||||
</style>
|
||||
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
|
||||
<box>
|
||||
<pen lineWidth="0.5" lineColor="#000000"/>
|
||||
</box>
|
||||
</style>
|
||||
<parameter name="DATA_INICIAL" class="java.util.Date"/>
|
||||
<parameter name="DATA_FINAL" class="java.util.Date"/>
|
||||
<parameter name="NOME_RELATORIO" class="java.lang.String"/>
|
||||
<parameter name="FILTROS" class="java.lang.String"/>
|
||||
<parameter name="USUARIO" class="java.lang.String"/>
|
||||
<parameter name="NUMPUNTOVENTA" class="java.lang.String"/>
|
||||
<parameter name="EMPRESA_ID" class="java.lang.Integer"/>
|
||||
<parameter name="EMPRESA" class="java.lang.String"/>
|
||||
<field name="DATA" class="java.util.Date"/>
|
||||
<field name="LINHA" class="java.lang.String"/>
|
||||
<field name="HORARIO" class="java.sql.Timestamp"/>
|
||||
<field name="ORIGEM" class="java.lang.String"/>
|
||||
<field name="DESTINO" class="java.lang.String"/>
|
||||
<field name="CLASSE" class="java.lang.String"/>
|
||||
<field name="SERVICO" class="java.math.BigDecimal"/>
|
||||
<field name="OCUPACAO" class="java.lang.Integer"/>
|
||||
<field name="CAPACIDADE" class="java.lang.Integer"/>
|
||||
<field name="TIPO_SERVICO" class="java.lang.String"/>
|
||||
<field name="PLATAFORMA" class="java.lang.String"/>
|
||||
<field name="EMPRESA" class="java.lang.String"/>
|
||||
<field name="CODLINHA" class="java.lang.String"/>
|
||||
<field name="INTERNET" class="java.lang.String"/>
|
||||
<variable name="POR_OCUPACAO" class="java.lang.Double">
|
||||
<variableExpression><![CDATA[$F{OCUPACAO}.doubleValue() / $F{CAPACIDADE}.doubleValue()]]></variableExpression>
|
||||
</variable>
|
||||
<group name="EMPRESA">
|
||||
<groupExpression><![CDATA[$F{EMPRESA}]]></groupExpression>
|
||||
<groupHeader>
|
||||
<band/>
|
||||
</groupHeader>
|
||||
</group>
|
||||
<background>
|
||||
<band splitType="Stretch"/>
|
||||
</background>
|
||||
<title>
|
||||
<band height="13">
|
||||
<staticText>
|
||||
<reportElement x="92" y="0" width="46" height="13" uuid="9fc7e58e-8625-41c4-a8ee-6454f6382d46"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8" isBold="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Serviço]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="0" y="0" width="61" height="13" uuid="3766fa33-6281-4576-a9d1-3b984e1976d3"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8" isBold="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Data]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="182" y="0" width="46" height="13" uuid="7e1f6b82-8a1f-4719-b942-41f0d7027aa8"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8" isBold="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Horário]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement mode="Transparent" x="611" y="0" width="50" height="13" forecolor="#000000" backcolor="#FFFFFF" uuid="95367884-2b52-4bbd-b716-852ff13290e9"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Ocupação]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement mode="Transparent" x="348" y="0" width="120" height="13" forecolor="#000000" backcolor="#FFFFFF" uuid="a39ab8f3-becb-44e3-b4f5-b7c43889508c"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Destino]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement mode="Transparent" x="661" y="0" width="68" height="13" forecolor="#000000" backcolor="#FFFFFF" uuid="170230ea-2a12-4444-9f13-c706d557ae8d"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Tipo]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement mode="Transparent" x="228" y="0" width="120" height="13" forecolor="#000000" backcolor="#FFFFFF" uuid="c0542d93-dde4-448d-932c-453d6a4a6882"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Origem]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement mode="Transparent" x="558" y="0" width="53" height="13" forecolor="#000000" backcolor="#FFFFFF" uuid="9c65b631-065c-49af-ab2c-3bcea583eaea"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Capacidade]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement mode="Transparent" x="468" y="0" width="90" height="13" forecolor="#000000" backcolor="#FFFFFF" uuid="a7f96097-c8fd-4ba0-bea7-7b40a0fc81f7"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Classe]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement mode="Transparent" x="729" y="0" width="51" height="13" forecolor="#000000" backcolor="#FFFFFF" uuid="0452264c-0f27-46d6-84ad-0fba6e5abdfa"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Plataforma]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement mode="Transparent" x="780" y="0" width="62" height="13" forecolor="#000000" backcolor="#FFFFFF" uuid="f596b16a-f9d9-42f5-b86f-3f468b0deb8f"/>
|
||||
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
|
||||
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
|
||||
<paragraph lineSpacing="Single"/>
|
||||
</textElement>
|
||||
<text><![CDATA[%Ocupação]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="61" y="0" width="31" height="13" uuid="3766fa33-6281-4576-a9d1-3b984e1976d3"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8" isBold="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Linha]]></text>
|
||||
</staticText>
|
||||
<staticText>
|
||||
<reportElement x="138" y="0" width="44" height="13" uuid="a427bc80-0924-441c-896b-a888a929d4f5"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8" isBold="true"/>
|
||||
</textElement>
|
||||
<text><![CDATA[Internet]]></text>
|
||||
</staticText>
|
||||
</band>
|
||||
</title>
|
||||
<columnHeader>
|
||||
<band splitType="Stretch"/>
|
||||
</columnHeader>
|
||||
<detail>
|
||||
<band height="13" splitType="Stretch">
|
||||
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
|
||||
<reportElement x="0" y="0" width="61" height="13" uuid="bc091860-adab-47d8-8352-982bc8e484a3"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{DATA}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement x="92" y="0" width="46" height="13" uuid="82c36c16-1662-4af9-a285-c935ab350e79"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{SERVICO}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="HH.mm" isBlankWhenNull="true">
|
||||
<reportElement x="182" y="0" width="46" height="13" uuid="ef45dd24-19e8-4e92-9759-f8e7a5c990eb"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{HORARIO}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement x="228" y="0" width="120" height="13" uuid="17011486-0d4c-4e22-b534-48e0bb025673"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{ORIGEM}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement x="348" y="0" width="120" height="13" uuid="a89c84e4-0e13-4e85-a565-9eb0bc6e5423"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{DESTINO}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField isBlankWhenNull="true">
|
||||
<reportElement x="468" y="0" width="90" height="13" uuid="7be97f5f-b36b-4679-befb-e5f2b4532963"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{CLASSE}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="###0" isBlankWhenNull="true">
|
||||
<reportElement x="558" y="0" width="53" height="13" uuid="7c1e2d86-f9ce-4730-866c-dc6cbdd0cf2c"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{CAPACIDADE}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="###0" isBlankWhenNull="true">
|
||||
<reportElement x="611" y="0" width="50" height="13" uuid="7c0246f5-739b-440c-a242-915117bd9fd1"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{OCUPACAO}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
|
||||
<reportElement x="661" y="0" width="68" height="13" uuid="dd401917-6047-4e1b-9722-31fe8d096594"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{TIPO_SERVICO}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
|
||||
<reportElement x="729" y="0" width="51" height="13" uuid="4dafd61b-ce2b-4690-b029-2a1382113099"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{PLATAFORMA}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="#,##0.00 %" isBlankWhenNull="true">
|
||||
<reportElement x="780" y="0" width="62" height="13" uuid="8ad565b3-b12c-4fef-a1c7-836e7415436d"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$V{POR_OCUPACAO}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
|
||||
<reportElement x="61" y="0" width="31" height="13" uuid="bc091860-adab-47d8-8352-982bc8e484a3"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{CODLINHA}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField>
|
||||
<reportElement x="138" y="0" width="44" height="13" uuid="773ac0f6-0c11-430d-8a10-8c62b272b064"/>
|
||||
<textElement textAlignment="Center">
|
||||
<font size="8"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$F{INTERNET}]]></textFieldExpression>
|
||||
</textField>
|
||||
</band>
|
||||
</detail>
|
||||
<noData>
|
||||
<band/>
|
||||
</noData>
|
||||
</jasperReport>
|
|
@ -30,6 +30,7 @@ import com.rjconsultores.ventaboletos.entidad.Empresa;
|
|||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioDemandasDetalhado;
|
||||
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioDemandasDetalhadoNovoLayout;
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.ParadaService;
|
||||
|
@ -148,14 +149,19 @@ public class RelatorioDemandasController extends MyGenericForwardComposer {
|
|||
}
|
||||
|
||||
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
|
||||
executarRelatorio();
|
||||
executarRelatorio(false);
|
||||
}
|
||||
|
||||
|
||||
public void onClick$btnExecutarRelatorioNovoLayout(Event ev) throws Exception {
|
||||
executarRelatorio(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
private void executarRelatorio() throws Exception {
|
||||
private void executarRelatorio(boolean novoLayout) throws Exception {
|
||||
Relatorio relatorio;
|
||||
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||
StringBuilder filtro = new StringBuilder();
|
||||
|
@ -238,7 +244,12 @@ public class RelatorioDemandasController extends MyGenericForwardComposer {
|
|||
|
||||
|
||||
if (detalhado.isChecked()) {
|
||||
|
||||
if (novoLayout)
|
||||
relatorio = new RelatorioDemandasDetalhadoNovoLayout(parametros, dataSourceRead.getConnection());
|
||||
else
|
||||
relatorio = new RelatorioDemandasDetalhado(parametros, dataSourceRead.getConnection());
|
||||
|
||||
} else if (diario.isChecked()) {
|
||||
relatorio = new RelatorioDemandasDiario(parametros, dataSourceRead.getConnection());
|
||||
} else {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winFiltroRelatorioDemandas"
|
||||
apply="${relatorioDemandasController}" contentStyle="overflow:auto"
|
||||
height="290px" width="600px" border="normal">
|
||||
height="268px" width="600px" border="normal">
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="20%" />
|
||||
|
@ -120,6 +120,9 @@
|
|||
<toolbar>
|
||||
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
|
||||
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
|
||||
|
||||
<button id="btnExecutarRelatorioNovoLayout"
|
||||
image="/gui/img/find.png" label="Novo Layout" />
|
||||
</toolbar>
|
||||
</window>
|
||||
</zk>
|
Loading…
Reference in New Issue