issue #8301 - fonte arial para sanserif

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@64436 d1611594-4594-4d17-8e1d-87c2c4800839
master
edgar 2017-01-03 11:49:56 +00:00
parent 9e3b66d69f
commit 36ef46a824
4 changed files with 40 additions and 23 deletions

View File

@ -58,9 +58,10 @@ public class RenderRelatorioJasper {
Locale locale = LocaleUtil.getLocale(); Locale locale = LocaleUtil.getLocale();
try { try {
ResourceBundle resource = ResourceBundle.getBundle("com.rjconsultores.ventaboletos.relatorios.internacionalizacao." + this.relatorio.getNome(), locale); ResourceBundle resource = ResourceBundle.getBundle("com.rjconsultores.ventaboletos.relatorios.internacionalizacao." + this.relatorio.getNome(), locale);
this.relatorio.getParametros().put(JRParameter.REPORT_RESOURCE_BUNDLE, resource); this.relatorio.getParametros().put(JRParameter.REPORT_RESOURCE_BUNDLE, resource);
this.relatorio.getParametros().put("BASE_DIR", getClass().getResource(this.relatorio.getBaseDir()).getPath());
/* Adicionar o arquivo de internacionalização para o subreporte quando informado */ /* Adicionar o arquivo de internacionalização para o subreporte quando informado */
if(this.relatorio.getNomeSubReporte() != null && this.relatorio.getNomeSubReporte().length > 0) { if(this.relatorio.getNomeSubReporte() != null && this.relatorio.getNomeSubReporte().length > 0) {

View File

@ -1,7 +1,7 @@
<?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="900" pageHeight="842" orientation="Landscape" columnWidth="860" 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="900" pageHeight="842" orientation="Landscape" columnWidth="860" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="5edc9f7a-8634-485f-96f7-c65a462aa868">
<property name="ireport.zoom" value="0.9090909090909127"/> <property name="ireport.zoom" value="0.9090909090909127"/>
<property name="ireport.x" value="0"/> <property name="ireport.x" value="56"/>
<property name="ireport.y" value="0"/> <property name="ireport.y" value="0"/>
<parameter name="BASE_DIR" class="java.lang.String"/> <parameter name="BASE_DIR" class="java.lang.String"/>
<field name="origem" class="java.lang.String"/> <field name="origem" class="java.lang.String"/>
@ -38,14 +38,14 @@
<textField> <textField>
<reportElement uuid="5d83d8a8-01aa-4022-9583-6808e65d2ec8" mode="Opaque" x="0" y="0" width="321" height="33" backcolor="#FFFF66"/> <reportElement uuid="5d83d8a8-01aa-4022-9583-6808e65d2ec8" mode="Opaque" x="0" y="0" width="321" height="33" backcolor="#FFFF66"/>
<textElement textAlignment="Center" verticalAlignment="Middle"> <textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="20" isBold="true"/> <font fontName="SansSerif" size="20" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{origem}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{origem}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="2c5b01a1-51db-478a-a307-83c9df5cea6e" x="321" y="0" width="539" height="33"/> <reportElement uuid="2c5b01a1-51db-478a-a307-83c9df5cea6e" x="321" y="0" width="539" height="33"/>
<textElement verticalAlignment="Middle"> <textElement verticalAlignment="Middle">
<font fontName="Arial" size="14" isBold="true"/> <font fontName="SansSerif" size="14" isBold="true"/>
<paragraph leftIndent="4"/> <paragraph leftIndent="4"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression>
@ -57,7 +57,7 @@
<staticText> <staticText>
<reportElement uuid="325e439b-ecaf-48cb-9c09-387c0649e47b" x="0" y="0" width="860" height="20"/> <reportElement uuid="325e439b-ecaf-48cb-9c09-387c0649e47b" x="0" y="0" width="860" height="20"/>
<textElement textAlignment="Center"> <textElement textAlignment="Center">
<font fontName="Arial" size="12" isBold="true"/> <font fontName="SansSerif" size="12" isBold="true"/>
</textElement> </textElement>
<text><![CDATA[Tabela de Preços R$]]></text> <text><![CDATA[Tabela de Preços R$]]></text>
</staticText> </staticText>
@ -75,7 +75,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none"> <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="10" isBold="true"/> <font fontName="SansSerif" size="10" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.destino}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.destino}]]></textFieldExpression>
</textField> </textField>
@ -89,7 +89,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none"> <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="8" isBold="true"/> <font fontName="SansSerif" size="8" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.tarifa}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.tarifa}]]></textFieldExpression>
</textField> </textField>
@ -103,7 +103,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none"> <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="8" isBold="true"/> <font fontName="SansSerif" size="8" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.pedagio}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.pedagio}]]></textFieldExpression>
</textField> </textField>
@ -117,7 +117,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none"> <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="8" isBold="true"/> <font fontName="SansSerif" size="8" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.taxaEmbarque}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.taxaEmbarque}]]></textFieldExpression>
</textField> </textField>
@ -131,7 +131,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none"> <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="8" isBold="true"/> <font fontName="SansSerif" size="8" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.totalSemSeguro}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.totalSemSeguro}]]></textFieldExpression>
</textField> </textField>
@ -145,7 +145,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none"> <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="8" isBold="true"/> <font fontName="SansSerif" size="8" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.totalComSeguro}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.totalComSeguro}]]></textFieldExpression>
</textField> </textField>
@ -159,7 +159,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none"> <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="Arial" size="8" isBold="true"/> <font fontName="SansSerif" size="8" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.valorSeguro}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.valorSeguro}]]></textFieldExpression>
</textField> </textField>
@ -177,7 +177,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement> <textElement>
<font fontName="Arial" size="12" isBold="true"/> <font fontName="SansSerif" size="12" isBold="true"/>
<paragraph leftIndent="2"/> <paragraph leftIndent="2"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{destino}+" ("+$F{tipoClasse}+")"]]></textFieldExpression> <textFieldExpression><![CDATA[$F{destino}+" ("+$F{tipoClasse}+")"]]></textFieldExpression>
@ -192,7 +192,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center"> <textElement textAlignment="Center">
<font fontName="Arial" size="10" isBold="true"/> <font fontName="SansSerif" size="10" isBold="true"/>
<paragraph rightIndent="2"/> <paragraph rightIndent="2"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{tarifa}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{tarifa}]]></textFieldExpression>
@ -207,7 +207,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center"> <textElement textAlignment="Center">
<font fontName="Arial" size="12" isBold="true"/> <font fontName="SansSerif" size="12" isBold="true"/>
<paragraph rightIndent="2"/> <paragraph rightIndent="2"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$V{totalSeguro}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{totalSeguro}]]></textFieldExpression>
@ -222,7 +222,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center"> <textElement textAlignment="Center">
<font fontName="Arial" size="12" isBold="true"/> <font fontName="SansSerif" size="12" isBold="true"/>
<paragraph rightIndent="2"/> <paragraph rightIndent="2"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$V{total}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{total}]]></textFieldExpression>
@ -237,7 +237,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center"> <textElement textAlignment="Center">
<font fontName="Arial" size="10" isBold="true"/> <font fontName="SansSerif" size="10" isBold="true"/>
<paragraph rightIndent="2"/> <paragraph rightIndent="2"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{taxaEmbarque}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{taxaEmbarque}]]></textFieldExpression>
@ -252,7 +252,7 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center"> <textElement textAlignment="Center">
<font fontName="Arial" size="10" isBold="true"/> <font fontName="SansSerif" size="10" isBold="true"/>
<paragraph rightIndent="2"/> <paragraph rightIndent="2"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{pedagio}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{pedagio}]]></textFieldExpression>
@ -267,14 +267,14 @@
<rightPen lineWidth="0.25" lineColor="#CCCCCC"/> <rightPen lineWidth="0.25" lineColor="#CCCCCC"/>
</box> </box>
<textElement textAlignment="Center"> <textElement textAlignment="Center">
<font fontName="Arial" isBold="true"/> <font fontName="SansSerif" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{seguroOpcional}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{seguroOpcional}]]></textFieldExpression>
</textField> </textField>
</band> </band>
</detail> </detail>
<pageFooter> <pageFooter>
<band height="46" splitType="Stretch"> <band height="47" splitType="Stretch">
<rectangle> <rectangle>
<reportElement uuid="88249295-7646-48b5-b723-522631570fc7" x="0" y="15" width="802" height="30" backcolor="#CCCCCC"/> <reportElement uuid="88249295-7646-48b5-b723-522631570fc7" x="0" y="15" width="802" height="30" backcolor="#CCCCCC"/>
<graphicElement> <graphicElement>
@ -284,18 +284,22 @@
<textField> <textField>
<reportElement uuid="b7957c63-89ec-4009-b196-373a274b59e1" mode="Opaque" x="0" y="15" width="860" height="29" backcolor="#CCCCCC"/> <reportElement uuid="b7957c63-89ec-4009-b196-373a274b59e1" mode="Opaque" x="0" y="15" width="860" height="29" backcolor="#CCCCCC"/>
<textElement textAlignment="Center" verticalAlignment="Middle"> <textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="10" isBold="true"/> <font fontName="SansSerif" size="10" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{label.msgAviso}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.msgAviso}]]></textFieldExpression>
</textField> </textField>
<image onErrorType="Blank">
<reportElement uuid="804159e8-555b-475f-a036-836a4230c641" x="0" y="16" width="186" height="29"/>
<imageExpression><![CDATA[$P{BASE_DIR}+"/imagens/artesp.png"]]></imageExpression>
</image>
</band> </band>
</pageFooter> </pageFooter>
<noData> <noData>
<band height="27"> <band height="30">
<textField> <textField>
<reportElement uuid="5954ac3d-3873-40e1-b643-cd910fa11ef2" x="0" y="1" width="860" height="26"/> <reportElement uuid="5954ac3d-3873-40e1-b643-cd910fa11ef2" x="0" y="1" width="860" height="26"/>
<textElement textAlignment="Center" markup="none"> <textElement textAlignment="Center" markup="none">
<font fontName="Arial" size="11" isBold="true"/> <font fontName="SansSerif" size="11" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField> </textField>

View File

@ -19,6 +19,7 @@ import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
public abstract class Relatorio { public abstract class Relatorio {
private static Logger log = Logger.getLogger(Relatorio.class); private static Logger log = Logger.getLogger(Relatorio.class);
private static final String DEFAULT_BASE_DIR = "/com/rjconsultores/ventaboletos/relatorios";
private Connection conexao; private Connection conexao;
protected Map<String, Object> parametros; protected Map<String, Object> parametros;
@ -28,6 +29,7 @@ public abstract class Relatorio {
private Set<String> infoMsg; private Set<String> infoMsg;
private JRBeanCollectionDataSource collectionDataSource; private JRBeanCollectionDataSource collectionDataSource;
private String[] nomeSubReporte; private String[] nomeSubReporte;
private String baseDir;
protected Relatorio(Map<String, Object> parametros, Connection conexao) { protected Relatorio(Map<String, Object> parametros, Connection conexao) {
this.parametros = parametros; this.parametros = parametros;
@ -157,4 +159,14 @@ public abstract class Relatorio {
log.error("Erro ao fechar a conexion", e); log.error("Erro ao fechar a conexion", e);
} }
} }
public String getBaseDir() {
//setado como parametro em RenderRelatorioJasper com a chave "BASE_DIR"
return baseDir == null ? DEFAULT_BASE_DIR : baseDir;
}
public void setBaseDir(String baseDir) {
this.baseDir = baseDir;
}
} }