Jump to content
Changes to the Jaspersoft community edition download ×

Problems with subreport


2005 IR Help

Recommended Posts

By: Silva - aloiziops

Problems with subreport

2005-05-24 14:27

Could someone help me? I created a master report that have a subreport. When a run my master report the subreport is not showed. What is happing?

 

 

 

 

By: Giulio Toffoli - gt78

RE: Problems with subreport

2005-05-24 15:51

 

It's hard to say: can you post your jrxmls? or provide

more details ?

 

Giulio

 

 

 

 

By: Silva - aloiziops

RE: Problems with subreport

2005-05-25 07:44

Here is the master report code.

 

<?xml version="1.0" encoding="UTF-8" ?>

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

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

<jasperReport

name="mestre"

columnCount="1"

printOrder="Vertical"

orientation="Portrait"

pageWidth="595"

pageHeight="842"

columnWidth="535"

columnSpacing="0"

leftMargin="30"

rightMargin="30"

topMargin="20"

bottomMargin="20"

whenNoDataType="NoPages"

isTitleNewPage="false"

isSummaryNewPage="false">

<property name="ireport.scriptlethandling" value="2" />

<import value="java.util.*" />

<import value="net.sf.jasperreports.engine.*" />

<import value="net.sf.jasperreports.engine.data.*" />

<parameter name="nomeSubReport" isForPrompting="true" class="java.lang.String">

<defaultValueExpression ><![CDATA["M:\SIL-RI\Artefatos\Modelos\CFSw\Controlador_Visao\siltram\WEB-INF\jspf\relatorio\protocolo\subrelatorio.jasper"]]></defaultValueExpression>

</parameter>

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

<field name="class" class="java.lang.Object"/>

<field name="comissao" class="java.lang.Boolean"/>

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

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

<field name="executivo" class="java.lang.Boolean"/>

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

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

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

<field name="outrosTipos" class="java.lang.Boolean"/>

<field name="parlamentar" class="java.lang.Boolean"/>

<field name="proposicaoSecundaria" class="java.lang.Boolean"/>

<field name="proposicaoSubSecundaria" class="java.lang.Boolean"/>

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

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

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

<background>

<band height="0" isSplitAllowed="true" >

</band>

</background>

<title>

<band height="50" isSplitAllowed="true" >

<staticText>

<reportElement

mode="Opaque"

x="79"

y="4"

width="369"

height="34"

forecolor="#000000"

backcolor="#FFFFFF"

key="staticText-1"

stretchType="NoStretch"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#FFFFFF" bottomBorder="None" bottomBorderColor="#000000"/>

<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" lineSpacing="Single">

<font fontName="Arial" pdfFontName="Helvetica" size="14" isBold="true" isItalic="false" isUnderline="true" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" />

</textElement>

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

</staticText>

</band>

</title>

<pageHeader>

<band height="50" isSplitAllowed="true" >

</band>

</pageHeader>

<columnHeader>

<band height="0" isSplitAllowed="true" >

</band>

</columnHeader>

<detail>

<band height="155" isSplitAllowed="true" >

<subreport isUsingCache="true">

<reportElement

mode="Opaque"

x="1"

y="47"

width="525"

height="47"

forecolor="#000000"

backcolor="#FFFFFF"

key="subreport-1"

stretchType="NoStretch"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{nomeSubReport}]]></subreportExpression>

</subreport>

<staticText>

<reportElement

mode="Opaque"

x="29"

y="11"

width="74"

height="16"

forecolor="#000000"

backcolor="#FFFFFF"

key="staticText-2"

stretchType="NoStretch"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#FFFFFF" bottomBorder="None" bottomBorderColor="#000000"/>

<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

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

</textElement>

<text><![CDATA[Texto estático]]></text>

</staticText>

<staticText>

<reportElement

mode="Opaque"

x="329"

y="9"

width="142"

height="24"

forecolor="#000000"

backcolor="#FFFFFF"

key="staticText-3"

stretchType="NoStretch"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#FFFFFF" bottomBorder="None" bottomBorderColor="#000000"/>

<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

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

</textElement>

<text><![CDATA[Texto estático]]></text>

</staticText>

</band>

</detail>

<columnFooter>

<band height="30" isSplitAllowed="true" >

</band>

</columnFooter>

<pageFooter>

<band height="50" isSplitAllowed="true" >

</band>

</pageFooter>

<lastPageFooter>

<band height="50" isSplitAllowed="true" >

</band>

</lastPageFooter>

<summary>

<band height="50" isSplitAllowed="true" >

</band>

</summary>

</jasperReport>

 

 

 

 

 

By: Silva - aloiziops

RE: Problems with subreport

2005-05-25 07:45

Here is the subreport code:

 

<?xml version="1.0" encoding="UTF-8" ?>

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

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

<jasperReport

name="subrelatorio"

columnCount="1"

printOrder="Vertical"

orientation="Portrait"

pageWidth="595"

pageHeight="842"

columnWidth="535"

columnSpacing="0"

leftMargin="30"

rightMargin="30"

topMargin="20"

bottomMargin="20"

whenNoDataType="NoPages"

isTitleNewPage="false"

isSummaryNewPage="false">

<property name="ireport.scriptlethandling" value="2" />

<import value="java.util.*" />

<import value="net.sf.jasperreports.engine.*" />

<import value="net.sf.jasperreports.engine.data.*" />

<queryString><![CDATA[select * from proposicao]]></queryString>

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

<field name="VERSAODOOBJETO" class="java.lang.Double"/>

<field name="NUMEROPROPOSICAO" class="java.lang.Double"/>

<field name="ANOPROPOSICAO" class="java.lang.Double"/>

<field name="NUMEROPROTOCOLO" class="java.lang.Double"/>

<field name="ANOPROTOCOLO" class="java.lang.Double"/>

<field name="DATAGERACAOPROTOCOLO" class="java.util.Date"/>

<field name="ESTADOPROPOSICAO" class="java.lang.Double"/>

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

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

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

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

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

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

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

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

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

<field name="PROPOSICAOVINCULADA" class="java.lang.Double"/>

<field name="PROPOSICAOSECUNDARIA" class="java.lang.Double"/>

<field name="TIPODENUMERACAO" class="java.lang.Double"/>

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

<background>

<band height="0" isSplitAllowed="true" >

</band>

</background>

<title>

<band height="0" isSplitAllowed="true" >

</band>

</title>

<pageHeader>

<band height="0" isSplitAllowed="true" >

</band>

</pageHeader>

<columnHeader>

<band height="0" isSplitAllowed="true" >

</band>

</columnHeader>

<detail>

<band height="34" isSplitAllowed="true" >

<line direction="TopDown">

<reportElement

mode="Opaque"

x="6"

y="24"

width="513"

height="0"

forecolor="#000000"

backcolor="#FFFFFF"

key="line-1"

stretchType="NoStretch"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<graphicElement stretchType="NoStretch" pen="Thin" fill="Solid" />

</line>

<staticText>

<reportElement

mode="Opaque"

x="399"

y="8"

width="104"

height="18"

forecolor="#000000"

backcolor="#FFFFFF"

key="staticText-1"

stretchType="NoStretch"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#FFFFFF" bottomBorder="None" bottomBorderColor="#000000"/>

<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

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

</textElement>

<text><![CDATA[Texto estático no sub]]></text>

</staticText>

<staticText>

<reportElement

mode="Opaque"

x="14"

y="4"

width="144"

height="15"

forecolor="#000000"

backcolor="#FFFFFF"

key="staticText-2"

stretchType="NoStretch"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#FFFFFF" bottomBorder="None" bottomBorderColor="#000000"/>

<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

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

</textElement>

<text><![CDATA[Texto estático no sub]]></text>

</staticText>

</band>

</detail>

<columnFooter>

<band height="0" isSplitAllowed="true" >

</band>

</columnFooter>

<pageFooter>

<band height="0" isSplitAllowed="true" >

</band>

</pageFooter>

<summary>

<band height="0" isSplitAllowed="true" >

</band>

</summary>

</jasperReport>

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...