Olá pessoal, tenho um relatório e o sub relatório. Quando cada um independentemente, eles abrem, mas ao tentar executá-los juntos apenas o principal aparece, como se o relatório principal não chamasse o outro.
Observei em outros tópicos e tutorias, algo referente a parâmetros, mas como podem ver abaixo, eu criei um parâmetro no subrelatório do tipo interger pois a dependência aqui é o código de um para o outro.
Segue abaixo o xml dos dois relatórios.
Principal:
<?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="SIS_REL_BOL_DIARIO" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="23d2736f-d074-43dd-95ac-b3c895a68806">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<subDataset name="dataset1" uuid="4dbfee9d-4866-47c7-ad5e-c6694a06484d"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["C:\\Users\\glauco\\Dropbox\\f2g@meustestes.comyr.com\\sisce_04-12-12\\relatorios\\"]]></defaultValueExpression>
</parameter>
<queryString language="hql">
<![CDATA[select
bolc.bolcCod as BolcCod,
bolc.sisCoordReg.cooDescricao as CoordDesc,
bolc.sisGrs.grsCidade as Grs,
bolc.sisMunicipio.munNome as Municipio,
bolc.sisLocalidade.locNome as Localidade,
bolc.sisLocalidade.locCategoria as Categoria,
bolc.sisAtividade.atiDescricao as AtiDesc,
bolc.sisAtividade.sisPesqLarvaria.peslAmostra as Amostra,
bolc.sisAtividade.atiNumSemana as NumSemana,
bolc.sisFuncionario.funNome as Agente,
bolc.bolcData as Data
from SisBoletimCabecalho bolc, SisCoordReg coordreg, SisGrs grs, SisMunicipio munic, SisLocalidade loc, SisAtividade ativ, SisFuncionario func
where coordreg.cooCod = bolc.sisCoordReg.cooCod
and grs.grsCod = bolc.sisGrs.grsCod
and munic.munCod = bolc.sisMunicipio.munCod
and loc.locCod = bolc.sisLocalidade.locCod
and ativ.atiCod = bolc.sisAtividade.atiCod
and func.funCod = bolc.sisFuncionario.funCod]]>
</queryString>
<field name="BolcCod" class="java.lang.Integer"/>
<field name="CoordDesc" class="java.lang.String"/>
<field name="Grs" class="java.lang.String"/>
<field name="Municipio" class="java.lang.String"/>
<field name="Localidade" class="java.lang.String"/>
<field name="Categoria" class="java.lang.String"/>
<field name="AtiDesc" class="java.lang.String"/>
<field name="Amostra" class="java.lang.Integer"/>
<field name="NumSemana" class="java.lang.Integer"/>
<field name="Agente" class="java.lang.String"/>
<field name="Data" class="java.util.Date"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="75" splitType="Stretch">
<image>
<reportElement uuid="075af4ef-1224-47d0-906f-9351b52cf451" x="472" y="11" width="100" height="50"/>
<imageExpression><![CDATA["SUS.jpg"]]></imageExpression>
</image>
<staticText>
<reportElement uuid="9aa6f6cd-c51f-475f-af9b-bc52b4876852" x="93" y="0" width="239" height="22"/>
<textElement>
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[PREFEITURA MUNICIPAL DE ITAOBIM]]></text>
</staticText>
<image>
<reportElement uuid="06d334ed-eaff-4bab-a3eb-d8dfd8183eb7" x="0" y="0" width="274" height="74"/>
<imageExpression><![CDATA["funasa.jpg"]]></imageExpression>
</image>
<staticText>
<reportElement uuid="9aa6f6cd-c51f-475f-af9b-bc52b4876852" x="93" y="13" width="252" height="22"/>
<textElement>
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[SECRETARIA MUNICIPAL DE SAÚDE - SMS]]></text>
</staticText>
<staticText>
<reportElement uuid="9aa6f6cd-c51f-475f-af9b-bc52b4876852" x="93" y="26" width="252" height="22"/>
<textElement>
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[MINISTÉRIO NACIONAL DE SAÚDE]]></text>
</staticText>
<staticText>
<reportElement uuid="9aa6f6cd-c51f-475f-af9b-bc52b4876852" x="93" y="39" width="252" height="22"/>
<textElement>
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[FUNDAÇÃO NACIONAL DE SAÚDE]]></text>
</staticText>
<staticText>
<reportElement uuid="9aa6f6cd-c51f-475f-af9b-bc52b4876852" x="93" y="52" width="372" height="22"/>
<textElement>
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[PROGRAMA DE CONTROLE DA FEBRE AMARELA E DENGUE]]></text>
</staticText>
<image>
<reportElement uuid="075af4ef-1224-47d0-906f-9351b52cf451" x="472" y="11" width="100" height="50"/>
<imageExpression><![CDATA["SUS.jpg"]]></imageExpression>
</image>
</band>
</title>
<pageHeader>
<band height="20" splitType="Stretch">
<line>
<reportElement uuid="2f823edd-fed9-45a0-8bc0-446f1d6980a6" x="0" y="1" width="555" height="1"/>
</line>
<staticText>
<reportElement uuid="944a7b69-49e0-45ad-8230-c85449dc6030" x="174" y="4" width="207" height="13"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[BOLETIM DIÁRIO - PESQUISA LARVÁRIA]]></text>
</staticText>
<line>
<reportElement uuid="2f823edd-fed9-45a0-8bc0-446f1d6980a6" x="0" y="19" width="555" height="1"/>
</line>
</band>
</pageHeader>
<columnHeader>
<band height="95" splitType="Stretch">
<staticText>
<reportElement uuid="9c9de376-df57-42a5-b219-6747b2c1f572" x="5" y="0" width="60" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[COORD. REG:]]></text>
</staticText>
<textField>
<reportElement uuid="45bc3dbd-d3ee-48e4-8ce6-2f505c67726f" x="63" y="0" width="76" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{CoordDesc}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="9c9de376-df57-42a5-b219-6747b2c1f572" x="174" y="0" width="23" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[GRS:]]></text>
</staticText>
<textField>
<reportElement uuid="9daa128b-6680-445e-a5d1-a76e1ccfb1b4" x="197" y="0" width="36" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{Grs}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="9c9de376-df57-42a5-b219-6747b2c1f572" x="272" y="0" width="47" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[MUNICÍPIO:]]></text>
</staticText>
<textField>
<reportElement uuid="9ae5f588-fd05-44b6-96eb-cf5b285b1bdf" x="319" y="0" width="100" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{Municipio}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="9c9de376-df57-42a5-b219-6747b2c1f572" x="5" y="17" width="60" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[LOCALIDADE:]]></text>
</staticText>
<staticText>
<reportElement uuid="9c9de376-df57-42a5-b219-6747b2c1f572" x="175" y="17" width="53" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[CATEGORIA:]]></text>
</staticText>
<textField>
<reportElement uuid="10bedc13-2593-4811-8eac-d2ee521c43ae" x="228" y="17" width="69" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{Categoria}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="68025f28-60c3-416d-805a-faf45ec93dd3" x="63" y="17" width="100" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{Localidade}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="9c9de376-df57-42a5-b219-6747b2c1f572" x="5" y="34" width="90" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[AGENTE DE SAÚDE:]]></text>
</staticText>
<textField>
<reportElement uuid="3e017b42-a917-4c65-8fa2-f33652771497" x="87" y="34" width="100" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{Agente}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="6bbbfa99-5087-4437-a2ce-fd2c551ea79c" x="31" y="51" width="43" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{Data}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="9c9de376-df57-42a5-b219-6747b2c1f572" x="5" y="51" width="29" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[DATA:]]></text>
</staticText>
<staticText>
<reportElement uuid="9c9de376-df57-42a5-b219-6747b2c1f572" x="175" y="51" width="122" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[SEMANA EPIDEMIOLÓGICA Nº:]]></text>
</staticText>
<textField>
<reportElement uuid="0610fcb0-cfcb-415e-9d4b-bf9ddfea4e78" x="297" y="51" width="29" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{NumSemana}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement uuid="7d9f304a-2015-40cf-83e1-daa90b9008ec" x="455" y="1" width="100" height="68"/>
</rectangle>
<staticText>
<reportElement uuid="9c9de376-df57-42a5-b219-6747b2c1f572" x="482" y="0" width="47" height="16"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[ATIVIDADE:]]></text>
</staticText>
<staticText>
<reportElement uuid="9c9de376-df57-42a5-b219-6747b2c1f572" x="457" y="11" width="15" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Nº:]]></text>
</staticText>
<staticText>
<reportElement uuid="9c9de376-df57-42a5-b219-6747b2c1f572" x="457" y="23" width="62" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[LI. AMOSTRA:]]></text>
</staticText>
<staticText>
<reportElement uuid="9c9de376-df57-42a5-b219-6747b2c1f572" x="457" y="37" width="51" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[DESCRIÇÃO:]]></text>
</staticText>
<textField>
<reportElement uuid="e114096e-c640-434b-9ee1-9b8276fd2a13" x="509" y="37" width="47" height="17"/>
<textElement>
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{AtiDesc}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="944a7b69-49e0-45ad-8230-c85449dc6030" x="197" y="78" width="135" height="17"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[ATIVIDADE DE CAMPO]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="125" splitType="Stretch">
<subreport>
<reportElement uuid="10115e12-be31-4919-bf6d-74a420a5b62e" x="7" y="4" width="548" height="115"/>
<subreportParameter name="BolcCod">
<subreportParameterExpression><![CDATA[$F{BolcCod}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "SIS_REL_BOL_DIARIO_LANC.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch">
<textField pattern="dd/MM/yyyy HH.mm.ss">
<reportElement uuid="c7007ff5-20ac-4a4f-acb8-b5246b4f1e69" x="0" y="34" width="100" height="20"/>
<textElement verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="6e7181f4-421f-481d-b5a5-928a8c75e57c" x="447" y="34" width="61" height="20"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA["Pág. "+$V{PAGE_NUMBER}+" de "]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement uuid="40d0fe17-4764-48ba-a5de-05677f34ff2e" x="498" y="34" width="110" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
</jasperReport>
Sub Relatório
<?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="SIS_REL_BOL_DIARIO_LANC" language="groovy" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="95e05bae-85b1-4352-859e-d264e4e7db49">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="BolcCod" class="java.lang.Integer"/>
<queryString language="hql">
<![CDATA[select boll.sisQuarteirao.quaCod as Quarteirao,
boll.sisEndereco.endNome as Endereco,
boll.sisEndereco.endTipoUnd as TipoUnd,
boll.bollIncetLarvic as Larvicida,
boll.bollIncetAdult as Adult,
boll.sisPendencia.penRec as Rec,
boll.sisPendencia.penRech as Rech,
boll.sisPendencia.penResg as Resg,
boll.bollNumDepTratado as DepTratado,
boll.bollNumDepInspecionado as DepInspecionado
from SisBoletimLanc boll
where boll.sisBoletimCabecalho.bolcCod LIKE $P{BolcCod}]]>
</queryString>
<field name="Quarteirao" class="java.lang.Integer"/>
<field name="Endereco" class="java.lang.String"/>
<field name="TipoUnd" class="java.lang.String"/>
<field name="Larvicida" class="java.lang.Integer"/>
<field name="Adult" class="java.lang.Integer"/>
<field name="Rec" class="java.lang.Integer"/>
<field name="Rech" class="java.lang.Integer"/>
<field name="Resg" class="java.lang.Integer"/>
<field name="DepTratado" class="java.lang.Integer"/>
<field name="DepInspecionado" class="java.lang.Integer"/>
<columnHeader>
<band height="20" splitType="Stretch">
<staticText>
<reportElement uuid="f513c404-f03d-4d1e-840d-dd22804d89ae" x="0" y="0" width="55" height="20"/>
<textElement textAlignment="Center"/>
<text><![CDATA[Quarteirao]]></text>
</staticText>
<staticText>
<reportElement uuid="a75474fe-801e-4f13-956c-5cdd5e321c0c" x="61" y="0" width="53" height="20"/>
<textElement/>
<text><![CDATA[Endereco]]></text>
</staticText>
<staticText>
<reportElement uuid="f1affb23-52a3-4e69-8c26-e10b31097fcc" x="166" y="0" width="44" height="20"/>
<textElement/>
<text><![CDATA[TipoUnd]]></text>
</staticText>
<staticText>
<reportElement uuid="9e60e466-1030-4910-b00d-225d3940fe7b" x="215" y="0" width="45" height="20"/>
<textElement/>
<text><![CDATA[Larvicida]]></text>
</staticText>
<staticText>
<reportElement uuid="d36f979a-ca25-43d1-83c9-d4cba0eb59d7" x="266" y="0" width="27" height="20"/>
<textElement/>
<text><![CDATA[Adult]]></text>
</staticText>
<staticText>
<reportElement uuid="5692cbf5-d2c9-4673-8b38-0a3cb50b599c" x="305" y="0" width="22" height="20"/>
<textElement/>
<text><![CDATA[Rec]]></text>
</staticText>
<staticText>
<reportElement uuid="ccb0575b-2be5-41d7-9036-642e49d2478a" x="341" y="0" width="33" height="20"/>
<textElement/>
<text><![CDATA[Rech]]></text>
</staticText>
<staticText>
<reportElement uuid="e20d42f1-453f-4a3a-aa1e-a82807edf2a7" x="380" y="0" width="30" height="20"/>
<textElement/>
<text><![CDATA[Resg]]></text>
</staticText>
<staticText>
<reportElement uuid="17d5abeb-e161-4824-aa41-8be0988a39cd" x="415" y="0" width="41" height="20"/>
<textElement/>
<text><![CDATA[Tratado]]></text>
</staticText>
<staticText>
<reportElement uuid="b36c5e21-d356-49b0-ba95-0ca4a95beb9a" x="462" y="0" width="68" height="20"/>
<textElement/>
<text><![CDATA[Inspecionado]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="21" splitType="Stretch">
<textField>
<reportElement uuid="9f894f54-a2cd-4e24-b191-bf6e74db3636" x="13" y="0" width="27" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{Quarteirao}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="c35299e4-6267-4ea4-858e-0e1540f8187d" x="61" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{Endereco}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="9b9ff0af-2d69-461d-b220-a2bfbfe33c59" x="168" y="0" width="37" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{TipoUnd}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="d9c45598-58de-4319-a993-e75b8728fb23" x="223" y="0" width="31" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{Larvicida}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="a2520720-e04e-4e68-b243-0bf091d706d1" x="266" y="0" width="27" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{Adult}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="ccc1d046-5f63-4344-84a8-a6ca3349ff14" x="298" y="0" width="37" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{Rec}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="7dea7093-41b1-40dd-b564-85ea5fe3a650" x="341" y="0" width="33" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{Rech}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="d172353d-d08b-40e3-96b3-3c2c1acd694f" x="380" y="0" width="30" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{Resg}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="6e12688d-aa2c-4291-be42-7dc1aaf9f35c" x="415" y="0" width="41" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{DepTratado}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="4d484c23-cd09-49c2-a75d-506a91775420" x="480" y="0" width="23" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{DepInspecionado}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
Desde já agradeço.