Jump to content

The true cause might be this one:


Recommended Posts

By: CARLOS ALBERTO SILVA - csilva2001

error with JRLoader.class.getClassLoader

2003-01-01 11:52

Please, what means the message:

*************************************************************************

* WARNING: Failure using Thread.currentThread().getContextClassLoader() *

* in JRLoader class. Using JRLoader.class.getClassLoader() instead. *

*************************************************************************

dori.jasper.engine.JRException: Could not load font from location : Helvetica-Bold ?

 

If I load reportA.pdf, it runs ok. If load reportB.pdf, I receive the message above. Both report use Helvetica-Bold font. Why just reportB.pdf send me that error message?...

OBS: both reports are compiled with jsperReport compiler.

Can you help me?

 

An embrace,

Carlos

 

 

 

 

By: Teodor Danciu - teodord

RE: error with JRLoader.class.getClassLoader

2003-01-02 01:54

 

Hi,

 

Are you sure there's no blank space in the

pdfFontName attribute, before or after

the Helvetica-Bold sequence?

 

Can I see your XML report design?

 

teodord@hotmail.com

 

Thank you,

Teodor

 

 

 

 

 

By: CARLOS ALBERTO SILVA - csilva2001

RE: error with JRLoader.class.getClassLoader

2003-01-02 06:24

OK.

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!-- Created with iReport - A designer for JasperReports -->

<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport

name="rptFabricante"

columnCount="1"

printOrder="Horizontal"

orientation="Portrait"

pageWidth="595"

pageHeight="842"

columnWidth="535"

columnSpacing="0"

leftMargin="30"

rightMargin="30"

topMargin="20"

bottomMargin="20"

whenNoDataType="BlankPage"

isTitleNewPage="false"

isSummaryNewPage="false">

<reportFont name="titulo1" isDefault="false" fontName="sansserif" size="16" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/>

<reportFont name="tituloX" isDefault="false" fontName="sansserif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/>

<reportFont name="infos" isDefault="false" fontName="sansserif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/>

<queryString><![CDATA[

SELECT PAIS_SIGLA, FABRICANTE_NOME, CODEMP, FABRICANTE_ENDERECO FROM TBLFABRICANTE, TBLPAIS ORDER BY FABRICANTE_NOME

]]></queryString>

<field name="PAIS_SIGLA" class="java.lang.String"/>

<field name="FABRICANTE_NOME" class="java.lang.String"/>

<field name="CODEMP" class="java.lang.String"/>

<field name="FABRICANTE_ENDERECO" class="java.lang.String"/>

<variable name="PAGE_COUNT11" class="java.lang.Integer" resetType="Report" calculation="Nothing">

</variable>

<title>

<band height="89">

<staticText>

<reportElement

mode="Transparent"

x="2"

y="6"

width="532"

height="21"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" lineSpacing="Single">

<font fontName="" reportFont="titulo1" pdfFontName="Times-Bold" size="16" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="true" pdfEncoding ="Cp1250" isStrikeThrough="false" />

</textElement>

<text><![CDATA[Diretoria de Saúde da Aeronáutica]]></text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="4"

y="60"

width="528"

height="21"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" lineSpacing="Single">

<font fontName="" pdfFontName="Times-Bold" size="14" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" />

</textElement>

<text><![CDATA[AgC-S6]]></text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="5"

y="32"

width="528"

height="21"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" lineSpacing="Single">

<font fontName="" pdfFontName="Times-Bold" size="14" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" />

</textElement>

<text><![CDATA[Agência de Catalogação]]></text>

</staticText>

</band>

</title>

<pageHeader>

<band height="64">

<staticText>

<reportElement

mode="Transparent"

x="3"

y="8"

width="528"

height="22"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" lineSpacing="Single">

<font fontName="" reportFont="tituloX" pdfFontName="Helvetica-Bold" size="14" isBold="true" isItalic="false" isUnderline="true" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[Relatório de Fabricante]]></text>

</staticText>

<textField isStretchWithOverflow="false" pattern="dd/MM/yyyy" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="386"

y="33"

width="139"

height="17"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Right" lineSpacing="Single">

<font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.util.Date">new Date()</textFieldExpression>

</textField>

</band>

</pageHeader>

<columnHeader>

<band height="26">

<staticText>

<reportElement

mode="Opaque"

x="14"

y="9"

width="37"

height="12"

forecolor="#400040"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[item]]></text>

</staticText>

<staticText>

<reportElement

mode="Opaque"

x="55"

y="9"

width="159"

height="12"

forecolor="#400040"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[Nome do Fabricante]]></text>

</staticText>

<staticText>

<reportElement

mode="Opaque"

x="221"

y="9"

width="62"

height="12"

forecolor="#400040"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[codeMP]]></text>

</staticText>

<line direction="TopDown">

<reportElement

mode="Opaque"

x="3"

y="21"

width="529"

height="0"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<graphicElement stretchType="NoStretch" pen="1Point" fill="Solid" />

</line>

<staticText>

<reportElement

mode="Transparent"

x="292"

y="8"

width="195"

height="11"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[Endereço]]></text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="493"

y="6"

width="36"

height="13"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[País]]></text>

</staticText>

</band>

</columnHeader>

<detail>

<band height="19">

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="16"

y="4"

width="29"

height="13"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="sansserif" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.Integer">$V{REPORT_COUNT}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="55"

y="4"

width="158"

height="13"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{FABRICANTE_NOME}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="221"

y="4"

width="65"

height="13"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{CODEMP}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="292"

y="4"

width="193"

height="13"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{FABRICANTE_ENDERECO}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="493"

y="4"

width="34"

height="13"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{PAIS_SIGLA}</textFieldExpression>

</textField>

</band>

</detail>

<columnFooter>

<band height="16">

</band>

</columnFooter>

<pageFooter>

<band height="40">

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="374"

y="9"

width="80"

height="15"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Right" lineSpacing="Single">

<font fontName="sansserif" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">"Página " + String.valueOf($V{PAGE_NUMBER}) + " de"</textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None" > <reportElement

mode="Transparent"

x="454"

y="9"

width="75"

height="15"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="Helvetica" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">" " + String.valueOf($V{PAGE_NUMBER})</textFieldExpression>

</textField>

</band>

</pageFooter>

<summary>

<band height="3">

</band>

</summary>

</jasperReport>

 

 

Embrace.

Carlos

 

 

 

 

By: Teodor Danciu - teodord

RE: error with JRLoader.class.getClassLoader

2003-01-02 07:41

 

Hi,

 

I was able to generate report in PDF format using

your XML without problems.

However, be aware that the pdfEncoding attribute

is case sensitive and the correct value would be

Cp1252 and not CP1252.

 

Could you post the entire stack trace you have?

 

Thank you,

Teodor

 

 

 

 

 

By: CARLOS ALBERTO SILVA - csilva2001

RE: error with JRLoader.class.getClassLoader

2003-01-02 08:46

OK.

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!-- Created with iReport - A designer for JasperReports -->

<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport

name="rptFabricante"

columnCount="1"

printOrder="Horizontal"

orientation="Portrait"

pageWidth="595"

pageHeight="842"

columnWidth="535"

columnSpacing="0"

leftMargin="30"

rightMargin="30"

topMargin="20"

bottomMargin="20"

whenNoDataType="BlankPage"

isTitleNewPage="false"

isSummaryNewPage="false">

<reportFont name="titulo1" isDefault="false" fontName="sansserif" size="16" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/>

<reportFont name="tituloX" isDefault="false" fontName="sansserif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/>

<reportFont name="infos" isDefault="false" fontName="sansserif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/>

<queryString><![CDATA[

SELECT PAIS_SIGLA, FABRICANTE_NOME, CODEMP, FABRICANTE_ENDERECO FROM TBLFABRICANTE, TBLPAIS ORDER BY FABRICANTE_NOME

]]></queryString>

<field name="PAIS_SIGLA" class="java.lang.String"/>

<field name="FABRICANTE_NOME" class="java.lang.String"/>

<field name="CODEMP" class="java.lang.String"/>

<field name="FABRICANTE_ENDERECO" class="java.lang.String"/>

<variable name="PAGE_COUNT11" class="java.lang.Integer" resetType="Report" calculation="Nothing">

</variable>

<title>

<band height="89">

<staticText>

<reportElement

mode="Transparent"

x="2"

y="6"

width="532"

height="21"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" lineSpacing="Single">

<font fontName="" reportFont="titulo1" pdfFontName="Times-Bold" size="16" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="true" pdfEncoding ="Cp1250" isStrikeThrough="false" />

</textElement>

<text><![CDATA[Diretoria de Saúde da Aeronáutica]]></text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="4"

y="60"

width="528"

height="21"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" lineSpacing="Single">

<font fontName="" pdfFontName="Times-Bold" size="14" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" />

</textElement>

<text><![CDATA[AgC-S6]]></text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="5"

y="32"

width="528"

height="21"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" lineSpacing="Single">

<font fontName="" pdfFontName="Times-Bold" size="14" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="false" />

</textElement>

<text><![CDATA[Agência de Catalogação]]></text>

</staticText>

</band>

</title>

<pageHeader>

<band height="64">

<staticText>

<reportElement

mode="Transparent"

x="3"

y="8"

width="528"

height="22"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" lineSpacing="Single">

<font fontName="" reportFont="tituloX" pdfFontName="Helvetica-Bold" size="14" isBold="true" isItalic="false" isUnderline="true" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[Relatório de Fabricante]]></text>

</staticText>

<textField isStretchWithOverflow="false" pattern="dd/MM/yyyy" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="386"

y="33"

width="139"

height="17"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Right" lineSpacing="Single">

<font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.util.Date">new Date()</textFieldExpression>

</textField>

</band>

</pageHeader>

<columnHeader>

<band height="26">

<staticText>

<reportElement

mode="Opaque"

x="14"

y="9"

width="37"

height="12"

forecolor="#400040"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[item]]></text>

</staticText>

<staticText>

<reportElement

mode="Opaque"

x="55"

y="9"

width="159"

height="12"

forecolor="#400040"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[Nome do Fabricante]]></text>

</staticText>

<staticText>

<reportElement

mode="Opaque"

x="221"

y="9"

width="62"

height="12"

forecolor="#400040"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[codeMP]]></text>

</staticText>

<line direction="TopDown">

<reportElement

mode="Opaque"

x="3"

y="21"

width="529"

height="0"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<graphicElement stretchType="NoStretch" pen="1Point" fill="Solid" />

</line>

<staticText>

<reportElement

mode="Transparent"

x="292"

y="8"

width="195"

height="11"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[Endereço]]></text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="493"

y="6"

width="36"

height="13"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<text><![CDATA[País]]></text>

</staticText>

</band>

</columnHeader>

<detail>

<band height="19">

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="16"

y="4"

width="29"

height="13"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="sansserif" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.Integer">$V{REPORT_COUNT}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="55"

y="4"

width="158"

height="13"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{FABRICANTE_NOME}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="221"

y="4"

width="65"

height="13"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{CODEMP}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="292"

y="4"

width="193"

height="13"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{FABRICANTE_ENDERECO}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="493"

y="4"

width="34"

height="13"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{PAIS_SIGLA}</textFieldExpression>

</textField>

</band>

</detail>

<columnFooter>

<band height="16">

</band>

</columnFooter>

<pageFooter>

<band height="40">

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="374"

y="9"

width="80"

height="15"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Right" lineSpacing="Single">

<font fontName="sansserif" reportFont="infos" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">"Página " + String.valueOf($V{PAGE_NUMBER}) + " de"</textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None" > <reportElement

mode="Transparent"

x="454"

y="9"

width="75"

height="15"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="Helvetica" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">" " + String.valueOf($V{PAGE_NUMBER})</textFieldExpression>

</textField>

</band>

</pageFooter>

<summary>

<band height="3">

</band>

</summary>

</jasperReport>

 

 

Embrace.

Carlos

 

 

 

 

By: CARLOS ALBERTO SILVA - csilva2001

RE: error with JRLoader.class.getClassLoader

2003-01-03 14:00

Hi, Teodor.

Can you tell anything about that question?

 

Carlos

 

 

 

 

By: Teodor Danciu - teodord

RE: error with JRLoader.class.getClassLoader

2003-01-06 02:05

 

Hi,

 

I don't have any idea.

Normally, the "Helvetica-Bold" font is one of the

14 built-in fonts that we could use with iText and

the program should not try to load it as a TTF file

from disk.

 

Maybe Paulo could give us a hint here.

 

Thank you,

Teodor

 

 

 

 

 

 

By: CARLOS ALBERTO SILVA - csilva2001

RE: error with JRLoader.class.getClassLoader

2003-01-06 05:38

I also do not understand... That same font works very well in other report. Please, what font you think I can use?

 

 

 

 

By: CARLOS ALBERTO SILVA - csilva2001

RE: error with JRLoader.class.getClassLoader

2003-01-06 16:03

Hi Teodor. Who is Paulo?

How can I communicate with Paulo?

 

Thanks,

Carlos

 

 

 

 

By: Teodor Danciu - teodord

RE: error with JRLoader.class.getClassLoader

2003-01-07 02:36

 

Hi,

 

I referred to Paulo Soares, one of the iText

developers.

He answers from time to time to iText

related questions posted on this forum.

 

You could try to post this on the iText forum

since I think it might be related to iText.

 

The XML you've sent me works fine on my machine.

 

Thank you,

Teodor

 

 

 

 

 

By: CARLOS ALBERTO SILVA - csilva2001

RE: error with JRLoader.class.getClassLoader

2003-01-07 05:23

Hi, Teodor. See the error message:

* WARNING: Failure using Thread.currentThread().getContextClassLoader() *

 

* in JRLoader class. Using JRLoader.class.getClassLoader() instead. *

 

Do you have same idea about that message: Failure using Thread.currentThread().getContextClassLoader() * ?

 

Maybe the error be before iText. That failure can be in my application code?

 

Embrace,

Carlos

 

 

 

 

By: Teodor Danciu - teodord

RE: error with JRLoader.class.getClassLoader

2003-01-07 05:34

 

Hi,

 

No. The problem is that somehow the font

"Helvetica-Bold" is not recognized as a build-in font.

Normally, the engine should not go so far and try

to load it from disk.

Of course, it will fail when trying to load from disk,

because there is no such TTF file anywhere.

This is where you get the exception.

But it should have not tried this in the first place.

 

Teodor

 

 

 

 

 

By: CARLOS ALBERTO SILVA - csilva2001

RE: error with JRLoader.class.getClassLoader

2003-01-13 16:36

Hi, Teodor. About my question, Paulo talk me:

"This is a JR error, not iText. "

Very bad, no? Teodor, I can't use JasperReport because pdf error. Will be I can do anything abaout? Reinstall Windows for example? Or maybed, put iText in classpath.... Please, tell me anything... I need builder my reports with JasperReport...

Embrace,

Carlos

 

 

 

 

By: Ben Plantinga - benplant

RE: error with JRLoader.class.getClassLoader

2003-01-13 22:59

Carlos:

 

I believe I had a similar problem to what you are describing. I had an existing JasperReport XML file which I then edited with iReport. I managed to fix an error that was similar to yours by changing how the fonts were used in the body of the XML file.

 

At the beginning of the report posted there are two report fonts set up. These are shown here:

 

<reportFont name="titulo1" isDefault="false" fontName="sansserif" size="16" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/>

<reportFont name="tituloX" isDefault="false" fontName="sansserif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="CP1252" isPdfEmbedded="false"/>

 

In the body of the XML file the following font descriptions are used:

 

<font fontName="" reportFont="tituloX" pdfFontName="Helvetica-Bold" size="14" isBold="true" isItalic="false" isUnderline="true" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />

<font fontName="" reportFont="titulo1" pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

 

I think the problem has something to do with iReports inserting more information in to the font description, such as the pdfFontName attribute. I think by replacing font descriptions like the two above with a simplified version (shown below), you should be able to fix the problem:

 

<font reportFont="titulo1" size="12" isBold="true" />

<font reportFont="tituloX" isUnderline="true" />

 

Because the report Font description is already done at the beginning of the XML file, you don't need the whole description, but can add attributes like isBold and isUnderline, etc. (At least it seems to be working for me).

 

I don't know the details of why this would be causing a problem, or if I am describing the solution correctly. But by replacing the full descriptions (including the pdfFontName attribute) with the simplified version in one of my own reports, I was able to solve my problem.

 

Hope that helps you,

Ben

 

 

 

 

 

 

By: CARLOS ALBERTO SILVA - csilva2001

RE: error with JRLoader.class.getClassLoader

2003-01-16 14:38

Hi, Ben. Thanks a lot for the your attention. But my problem continue... I would like fix the error. JasperReport would be the report generator for my application. Maybe in next version, Teodor can resolve that problem...

A embrace,

Carlos

 

 

 

 

By: CARLOS ALBERTO SILVA - csilva2001

RE: error with JRLoader.class.getClassLoader

2003-01-16 15:00

Hi, Ben. I created news fonts for reports. Deleted old ones. Compile the report and this time its ok with html and pdf. At least I can compile and execute. I think resolved the problem.

Carlos

 

 

 

 

By: CARLOS ALBERTO SILVA - csilva2001

RE: error with JRLoader.class.getClassLoader

2003-01-02 08:55

Here the messages:

 

Compilation running time : 21261

 

Opening connection....

 

Executing query SELECT PAIS_SIGLA, FABRICANTE_NOME, CODEMP, FABRICANTE_ENDERECO FROM TBLFABRICANTE, TBLPAIS ORDER BY FABRICANTE_NOME

 

Print generated succesfully.

 

Exporting pdf to file... C:RepSGMSWriterptFabricante.pdf

 

*************************************************************************

 

* WARNING: Failure using Thread.currentThread().getContextClassLoader() *

 

* in JRLoader class. Using JRLoader.class.getClassLoader() instead. *

 

*************************************************************************

 

dori.jasper.engine.JRException: Could not load font from location : Helvetica-Bold

 

at dori.jasper.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:850)

 

at dori.jasper.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:316)

 

at dori.jasper.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:270)

 

at dori.jasper.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:214)

 

at IReportCompiler.main(IReportCompiler.java:197)

 

 

 

Abnormal termination!

 

OK?

 

 

 

 

 

By: Teodor Danciu - teodord

RE: error with JRLoader.class.getClassLoader

2003-12-19 15:39

 

Hi,

 

The true cause might be this one:

 

https://sourceforge.net/forum/forum.php?thread_id=954508&forum_id=113530

 

But it could be any other mismatch between the

pdfFontName and the pdfEncoding atttributs.

The JasperReports code was update on the CVS

repository to give more details about the cause

of this exception.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...