Ae galera do GUJ, td bem?
Estou com alguns problemas com relatórios gerados apartir com o iReport.
Tenho um relatorio principal que deve chamar um subrelatorio. O código deste relatorio principal segue abaixo
<?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="report name" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<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>
<style name="table 1">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table 1_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="Alunos">
<queryString language="SQL">
<![CDATA[select * from Aluno]]>
</queryString>
<field name="nome" class="java.lang.String"/>
<field name="matricula" class="java.lang.String"/>
<field name="nomePai" class="java.lang.String"/>
<field name="nomeMae" class="java.lang.String"/>
<field name="id_turma" class="java.lang.Integer"/>
<field name="id_Status" class="java.lang.Integer"/>
<group name="nome">
<groupExpression><![CDATA[$F{nome}]]></groupExpression>
</group>
<group name="matricula">
<groupExpression><![CDATA[$F{matricula}]]></groupExpression>
</group>
<group name="nomePai">
<groupExpression><![CDATA[$F{nomePai}]]></groupExpression>
</group>
<group name="nomeMae">
<groupExpression><![CDATA[$F{nomeMae}]]></groupExpression>
</group>
</subDataset>
<subDataset name="dataset1"/>
<subDataset name="Table Dataset 1"/>
<subDataset name="teste">
<queryString language="SQL">
<![CDATA[SELECT `Aluno`.`nome`, `Aluno`.`RG`, `Turma`.`nome` as turma, `Aluno`.`matricula`, `Aluno`.`telefone`, `Aluno`.`celular`,
`Livro`.`titulo`, `Livro`.`volume`, `Autor`.`nome` as Autor, `ItensMovimentacaoLivro`.`quantidade`,
`ItensMovimentacaoLivro`.`numeroSerieLocacao`
FROM `ItensMovimentacaoLivro`
INNER JOIN `MovimentacaoLivro` ON (`ItensMovimentacaoLivro`.`id_movimentacaoLivro` = `MovimentacaoLivro`.`id`)
INNER JOIN `Aluno` ON (`MovimentacaoLivro`.`id_aluno` = `Aluno`.`id`)
INNER JOIN `Livro` ON (`ItensMovimentacaoLivro`.`id_livro` = `Livro`.`id`)
INNER JOIN `Turma` ON (`Aluno`.`id_turma` = `Turma`.`id`)
INNER JOIN `Autor` ON (`Livro`.`id_autor` = `Autor`.`id`)
WHERE `ItensMovimentacaoLivro`.`id_movimentacaoLivro` = 73]]>
</queryString>
<field name="titulo" class="java.lang.String"/>
<field name="numeroSerieLocacao" class="java.lang.Integer"/>
<field name="quantidade" class="java.lang.Integer"/>
<field name="Autor" class="java.lang.String"/>
<field name="volume" class="java.lang.Integer"/>
<group name="titulo">
<groupExpression><![CDATA[$F{titulo}]]></groupExpression>
</group>
<group name="Autor">
<groupExpression><![CDATA[$F{Autor}]]></groupExpression>
</group>
<group name="volume">
<groupExpression><![CDATA[$F{volume}]]></groupExpression>
</group>
<group name="numeroSerieLocacao">
<groupExpression><![CDATA[$F{numeroSerieLocacao}]]></groupExpression>
</group>
</subDataset>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["C:\\Users\\Admin\\Documents\\NetBeansProjects\\Tutorialrelatorios\\src\\relatorios\\"]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[SELECT `Aluno`.`nome`,
`Aluno`.`RG`,
`Turma`.`nome` as nome_turma,
`Aluno`.`matricula`,
`Aluno`.`telefone`,
`Aluno`.`celular`
FROM `ItensMovimentacaoLivro`
INNER JOIN `MovimentacaoLivro` ON (`ItensMovimentacaoLivro`.`id_movimentacaoLivro` = `MovimentacaoLivro`.`id`)
INNER JOIN `Aluno` ON (`MovimentacaoLivro`.`id_aluno` = `Aluno`.`id`)
INNER JOIN `Turma` ON (`Aluno`.`id_turma` = `Turma`.`id`)
WHERE `ItensMovimentacaoLivro`.`id_movimentacaoLivro` = 85
group by`Aluno`.`nome`,
`Aluno`.`RG`,
`Turma`.`nome`,
`Aluno`.`matricula`,
`Aluno`.`telefone`,
`Aluno`.`celular`]]>
</queryString>
<field name="nome" class="java.lang.String"/>
<field name="RG" class="java.lang.String"/>
<field name="nome_turma" class="java.lang.String"/>
<field name="matricula" class="java.lang.String"/>
<field name="telefone" class="java.lang.String"/>
<field name="celular" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="85" splitType="Stretch">
<image>
<reportElement x="485" y="4" width="70" height="81"/>
<imageExpression><![CDATA["C:\\Users\\Admin\\Documents\\NetBeansProjects\\Tutorialrelatorios\\src\\imagens\\Brasao.gif"]]></imageExpression>
</image>
<image>
<reportElement x="-1" y="0" width="162" height="81"/>
<imageExpression><![CDATA["C:\\Users\\Admin\\Documents\\NetBeansProjects\\Tutorialrelatorios\\src\\imagens\\ifg.jpg"]]></imageExpression>
</image>
<staticText>
<reportElement x="161" y="0" width="273" height="81"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10" isBold="true"/>
</textElement>
<text><![CDATA[MINISTÉRIO DA EDUCAÇÃO
INSTITUTO FEDERAL DE EDUCAÇÃO, CIÊNCIA E
TECNOLOGIA DE GOIÁS CAMPUS INHUMAS
COORDENAÇÃO DE APOIO AO ENSINO]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="41" splitType="Stretch">
<staticText>
<reportElement x="54" y="0" width="398" height="41"/>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font size="15" isBold="true" isItalic="false"/>
</textElement>
<text><![CDATA[TERMO DE COMPROMISSO DOS LIVROS DIDÁTICOS]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="138" splitType="Stretch">
<staticText>
<reportElement x="32" y="13" width="22" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Bottom" markup="none">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[Eu]]></text>
</staticText>
<line>
<reportElement x="64" y="31" width="359" height="1"/>
</line>
<staticText>
<reportElement x="434" y="13" width="28" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Bottom" markup="none">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[R.G]]></text>
</staticText>
<line>
<reportElement x="462" y="31" width="93" height="1"/>
</line>
<textField>
<reportElement x="78" y="12" width="100" height="20"/>
<textElement verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[$F{nome}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="36" width="32" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[Turma]]></text>
</staticText>
<line>
<reportElement positionType="FixRelativeToBottom" x="32" y="55" width="208" height="1"/>
</line>
<staticText>
<reportElement x="245" y="36" width="47" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[matrícula]]></text>
</staticText>
<line>
<reportElement x="292" y="55" width="131" height="1"/>
</line>
<staticText>
<reportElement x="423" y="36" width="140" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[, declaro que recebi os livros]]></text>
</staticText>
<staticText>
<reportElement x="0" y="56" width="563" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[abaixo relacionados, a título de empréstimo, e me comprometo a devolvê-los no final do ano letivo, em perfeito estado de]]></text>
</staticText>
<staticText>
<reportElement x="0" y="77" width="54" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[conversão.]]></text>
</staticText>
<staticText>
<reportElement x="32" y="97" width="531" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[Fico ciente que a não devolução no prazo previsto, implica na retenção de qualquer documentação que o aluno venha]]></text>
</staticText>
<staticText>
<reportElement x="0" y="115" width="100" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[necessitar.]]></text>
</staticText>
<textField>
<reportElement x="463" y="11" width="100" height="20"/>
<textElement verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[$F{RG}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="301" y="35" width="100" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[$F{matricula}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="61" y="42" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{nome_turma}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="110" splitType="Stretch">
<subreport>
<reportElement x="-1" y="0" width="556" height="110"/>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "relatoriosLivrosLocados.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
<columnFooter>
<band height="54" splitType="Stretch">
<staticText>
<reportElement x="283" y="3" width="169" height="18"/>
<textElement>
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[Por ser verdade firmo o presente.]]></text>
</staticText>
<staticText>
<reportElement x="283" y="22" width="46" height="20"/>
<textElement>
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[Inhumas,]]></text>
</staticText>
<textField pattern="dd/MM/yyyy">
<reportElement x="334" y="21" width="91" height="21"/>
<textElement textAlignment="Left" verticalAlignment="Top">
<font fontName="Times New Roman" size="12"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</band>
</columnFooter>
<pageFooter>
<band height="247" splitType="Stretch">
<textField>
<reportElement x="434" y="227" width="81" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Página "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="515" y="227" width="40" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<line>
<reportElement x="100" y="56" width="352" height="3"/>
</line>
<staticText>
<reportElement x="216" y="59" width="100" height="20"/>
<textElement>
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[Assinatura do aluno]]></text>
</staticText>
<line>
<reportElement x="100" y="104" width="352" height="3"/>
</line>
<staticText>
<reportElement x="149" y="107" width="180" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[Assinatura: Pai, Mãe ou responsável]]></text>
</staticText>
<staticText>
<reportElement x="2" y="137" width="52" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[Endereço:]]></text>
</staticText>
<line>
<reportElement x="64" y="154" width="388" height="3"/>
</line>
<staticText>
<reportElement x="2" y="157" width="30" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[CEP.:]]></text>
</staticText>
<staticText>
<reportElement x="188" y="157" width="85" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[Telefone FIXO:]]></text>
</staticText>
<staticText>
<reportElement x="366" y="157" width="32" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[CEL.]]></text>
</staticText>
<line>
<reportElement x="32" y="176" width="156" height="1"/>
</line>
<line>
<reportElement x="398" y="173" width="103" height="1"/>
</line>
<line>
<reportElement x="265" y="174" width="100" height="1"/>
</line>
<textField>
<reportElement x="401" y="155" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[$F{celular}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="265" y="159" width="100" height="16"/>
<textElement textAlignment="Center" verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[$F{telefone}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="301" y="127" width="31" height="20"/>
<textElement>
<font fontName="Times New Roman" size="12"/>
</textElement>
<text><![CDATA[CPF:]]></text>
</staticText>
<line>
<reportElement x="334" y="136" width="118" height="1"/>
</line>
</band>
</pageFooter>
</jasperReport>
o código do subrelatório que deve ser chamado é o seguinte
<?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="relatorio_Livros_Locados" language="groovy" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<queryString>
<![CDATA[SELECT `Aluno`.`nome`, `Aluno`.`RG`, `Turma`.`nome` as turma, `Aluno`.`matricula`, `Aluno`.`telefone`, `Aluno`.`celular`,
`Livro`.`titulo`, `Livro`.`volume`, `Autor`.`nome` as Autor, `ItensMovimentacaoLivro`.`quantidade`,
`ItensMovimentacaoLivro`.`numeroSerieLocacao`
FROM `ItensMovimentacaoLivro`
INNER JOIN `MovimentacaoLivro` ON (`ItensMovimentacaoLivro`.`id_movimentacaoLivro` = `MovimentacaoLivro`.`id`)
INNER JOIN `Aluno` ON (`MovimentacaoLivro`.`id_aluno` = `Aluno`.`id`)
INNER JOIN `Livro` ON (`ItensMovimentacaoLivro`.`id_livro` = `Livro`.`id`)
INNER JOIN `Turma` ON (`Aluno`.`id_turma` = `Turma`.`id`)
INNER JOIN `Autor` ON (`Livro`.`id_autor` = `Autor`.`id`)
WHERE `ItensMovimentacaoLivro`.`id_movimentacaoLivro` = 85]]>
</queryString>
<field name="nome" class="java.lang.String"/>
<field name="RG" class="java.lang.String"/>
<field name="turma" class="java.lang.String"/>
<field name="matricula" class="java.lang.String"/>
<field name="telefone" class="java.lang.String"/>
<field name="celular" class="java.lang.String"/>
<field name="titulo" class="java.lang.String"/>
<field name="volume" class="java.lang.Integer"/>
<field name="Autor" class="java.lang.String"/>
<field name="quantidade" class="java.lang.Integer"/>
<field name="numeroSerieLocacao" class="java.lang.Integer"/>
<background>
<band splitType="Stretch"/>
</background>
<columnHeader>
<band height="35" splitType="Stretch">
<staticText>
<reportElement x="74" y="15" width="42" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Título]]></text>
</staticText>
<staticText>
<reportElement x="238" y="15" width="52" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Autor(es):]]></text>
</staticText>
<staticText>
<reportElement x="330" y="15" width="44" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Volume]]></text>
</staticText>
<staticText>
<reportElement x="400" y="15" width="37" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Qtde]]></text>
</staticText>
<staticText>
<reportElement x="446" y="15" width="104" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Série]]></text>
</staticText>
<staticText>
<reportElement x="0" y="-5" width="100" height="20"/>
<textElement verticalAlignment="Bottom">
<font fontName="Times New Roman" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Livros Locados]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="21" splitType="Stretch">
<textField>
<reportElement x="12" y="0" width="180" height="21"/>
<textElement verticalAlignment="Middle">
<font fontName="Times New Roman" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{titulo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="330" y="2" width="44" height="19"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Times New Roman" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{volume}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="386" y="2" width="60" height="19"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Times New Roman" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{quantidade}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="446" y="2" width="104" height="19"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Times New Roman" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{numeroSerieLocacao}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="197" y="2" width="133" height="19"/>
<textElement verticalAlignment="Middle">
<font fontName="Times New Roman" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{Autor}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
Quando executo o Preview do relatorio principal ele carrega corretamente o subrelatório, porém quando tento executá-lo a partir de uma classe Java ou aplicação me retorna o seguinte erro:
Exception in thread "main" net.sf.jasperreports.engine.JRRuntimeException: Unknown hyperlink target 0
at net.sf.jasperreports.engine.JRHyperlinkHelper.getLinkTarget(JRHyperlinkHelper.java:273)
at net.sf.jasperreports.engine.base.JRBaseTextField.normalizeLinkTarget(JRBaseTextField.java:317)
at net.sf.jasperreports.engine.base.JRBaseTextField.readObject(JRBaseTextField.java:381)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at java.util.ArrayList.readObject(ArrayList.java:593)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480)
at net.sf.jasperreports.engine.base.JRBaseReport.readObject(JRBaseReport.java:736)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:94)
at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:264)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:321)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:270)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:260)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:486)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1427)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:729)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:256)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:114)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:911)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:814)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:421)
at tutorialrelatorios.executa.main(executa.java:62)
Java Result: 1
O código da classe onde tento abrir o relatório é o seguinte
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tutorialrelatorios;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JOptionPane;
import net.sf.jasperreports.engine.JREmptyDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.view.JasperViewer;
import tutorialrelatorios.jdbc.ConexaoBanco;
import tutorialrelatorios.util.escreveRelatorio;
/**
*
* @author Admin
*/
public class executa {
public static void main(String args[]) throws ClassNotFoundException, SQLException{
String reportSource = "C:/Users/Admin/Documents/NetBeansProjects/Tutorialrelatorios/src/relatorios/novoRelatorio.jrxml";
String reportDest = "C:/Users/Admin/Documents/NetBeansProjects/Tutorialrelatorios/src/relatorios/novoRelatorio.html";
Map<String, Object> params = new HashMap<String, Object>();
params.put("reportTitle", "Meu Primeiro Relatório");
params.put("author", "Walison José");
params.put("startDate", (new java.util.Date()).toString());
try
{
JasperReport jasperReport =
JasperCompileManager.compileReport(reportSource);
// Make the driver class available.
Class.forName("com.mysql.jdbc.Driver");
// Create a connection to pass into the report.
java.sql.Connection conn = DriverManager.getConnection(
"jdbc:mysql://10.4.0.90:3306/SCAL", "admin", "123");
// Replace the empty JR datasource parameter with
// the connection parameter named conn.
JasperPrint jasperPrint = JasperFillManager.fillReport(
jasperReport, params, conn);
JasperExportManager.exportReportToHtmlFile(
jasperPrint, reportDest);
JasperViewer.viewReport(jasperPrint);
}
catch (JRException ex)
{
ex.printStackTrace();
}
}
}
Estou utilizando a versão 3.5.2 do JasperReport, 2.1 do iText…
Alguém já passou por esse problema?