Jump to content
Changes to the Jaspersoft community edition download ×

subreport not shown & log


2005 IR Help

Recommended Posts

By: Diego - pirlango

subreport not shown & log

2004-10-25 04:55

Hi everybody

 

I'm trying to produce a master detailed report using subreports, but the subreport information is not shown. I can get the subreport alone filled with data, but not inside the master report.

 

I'm almost sure both contains data, when subreport is called inside master report. To be sure about that I tried to define a log4j logger to see jasperreports log, but I can see no information. Is there any DEBUG log in jasperreports? is this logger correct log4j.logger.net.sf.jasperreports=DEBUG, logfile1, stdout?

 

I've checked previous post, and tried different configurations, but still no data appears, and I can not get any log to see what's wrong with my files. Can you help me, please?

 

Here are the xml I use:

 

MASTER REPORT

 

<?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="ReportDomain"

columnCount="1"

printOrder="Vertical"

orientation="Portrait"

pageWidth="595"

pageHeight="842"

columnWidth="595"

columnSpacing="5"

leftMargin="0"

rightMargin="0"

topMargin="0"

bottomMargin="0"

whenNoDataType="AllSectionsNoDetail"

isTitleNewPage="false"

isSummaryNewPage="false">

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

<reportFont name="Arial_Normal" isDefault="true" fontName="Arial" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<reportFont name="Arial_Italic" isDefault="false" fontName="Arial" size="8" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<parameter name="SubReportDomain" isForPrompting="true" class="net.sf.jasperreports.engine.JasperReport"/>

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

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

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

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

<queryString><![CDATA[sELECT DOMAINS.K_LOGIN, DOMAINS.C_TYPE, DOMAINS.K_DOMAIN FROM DOMAINS]]></queryString>

<field name="K_DOMAIN" class="java.lang.Integer"/>

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

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

<background>

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

</band>

</background>

<title>

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

<line direction="TopDown">

<reportElement

mode="Opaque"

x="0"

y="0"

width="515"

height="0"

forecolor="#000000"

backcolor="#FFFFFF"

key="line"

stretchType="RelativeToBandHeight"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

</line>

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

mode="Opaque"

x="38"

y="16"

width="515"

height="30"

forecolor="#000000"

backcolor="#FFFFFF"

key="textField"

stretchType="RelativeToBandHeight"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font reportFont="Arial_Normal" size="22"/>

</textElement>

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

</textField>

</band>

</title>

<pageHeader>

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

<staticText>

<reportElement

mode="Opaque"

x="4"

y="6"

width="55"

height="15"

forecolor="#000000"

backcolor="#FF0033"

key="staticText"

stretchType="RelativeToBandHeight"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font reportFont="Arial_Bold"/>

</textElement>

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

</staticText>

<staticText>

<reportElement

mode="Opaque"

x="54"

y="6"

width="205"

height="15"

forecolor="#000000"

backcolor="#FF0033"

key="staticText"

stretchType="RelativeToBandHeight"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font reportFont="Arial_Bold"/>

</textElement>

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

</staticText>

<staticText>

<reportElement

mode="Opaque"

x="259"

y="6"

width="330"

height="15"

forecolor="#000000"

backcolor="#FF0033"

key="staticText"

stretchType="RelativeToBandHeight"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font reportFont="Arial_Bold"/>

</textElement>

<text><![CDATA[Credito Gastado]]></text>

</staticText>

</band>

</pageHeader>

<columnHeader>

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

</band>

</columnHeader>

<detail>

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

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

mode="Opaque"

x="47"

y="0"

width="515"

height="10"

forecolor="#000000"

backcolor="#FFFFFF"

key="textField"

stretchType="RelativeToBandHeight"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="true"/>

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

<font reportFont="Arial_Bold"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{K_LOGIN}+ " (" + $F{K_DOMAIN}+ ")"]]></textFieldExpression>

</textField>

<staticText>

<reportElement

mode="Opaque"

x="152"

y="11"

width="269"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

key="staticText-1"

stretchType="RelativeToBandHeight"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="true"/>

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

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

</textElement>

<text><![CDATA[sTATIC TEXT IN REPORT]]></text>

</staticText>

<subreport isUsingCache="true">

<reportElement

mode="Opaque"

x="0"

y="32"

width="591"

height="60"

forecolor="#FF00FF"

backcolor="#FF0000"

key="subreport"

stretchType="RelativeToBandHeight"

positionType="FixRelativeToBottom"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="true"/>

<parametersMapExpression><![CDATA[new HashMap($P{REPORT_PARAMETERS_MAP})]]></parametersMapExpression>

<subreportParameter name="K_DOMAIN">

<subreportParameterExpression><![CDATA[$F{K_DOMAIN}]]></subreportParameterExpression>

</subreportParameter>

<subreportParameter name="K_LOGIN">

<subreportParameterExpression><![CDATA[$F{K_LOGIN}]]></subreportParameterExpression>

</subreportParameter>

<subreportParameter name="C_TYPE">

<subreportParameterExpression><![CDATA[$F{C_TYPE}]]></subreportParameterExpression>

</subreportParameter>

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

<subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{SubReportDomain}]]></subreportExpression>

</subreport>

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

 

 

SUBREPORT

 

<?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="SubReportDomain"

columnCount="1"

printOrder="Vertical"

orientation="Portrait"

pageWidth="595"

pageHeight="842"

columnWidth="595"

columnSpacing="5"

leftMargin="0"

rightMargin="0"

topMargin="0"

bottomMargin="0"

whenNoDataType="AllSectionsNoDetail"

isTitleNewPage="false"

isSummaryNewPage="false">

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

<reportFont name="Arial_Normal" isDefault="true" fontName="Arial" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<reportFont name="Arial_Italic" isDefault="false" fontName="Arial" size="8" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

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

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

<parameter name="K_DOMAIN" isForPrompting="false" class="java.lang.Integer"/>

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

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

<queryString><![CDATA[sELECT K_LOGIN

FROM USERS

WHERE USERS.K_DOMAIN = $P{K_DOMAIN}]]></queryString>

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

<background>

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

</band>

</background>

<title>

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

<line direction="TopDown">

<reportElement

mode="Opaque"

x="0"

y="0"

width="515"

height="1"

forecolor="#000000"

backcolor="#FFFFFF"

key="line"

stretchType="RelativeToBandHeight"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

</line>

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

mode="Opaque"

x="0"

y="1"

width="515"

height="10"

forecolor="#000000"

backcolor="#FFFFFF"

key="textField"

stretchType="RelativeToBandHeight"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font reportFont="Arial_Normal"/>

</textElement>

<textFieldExpression class="java.lang.Integer"><![CDATA[$P{K_DOMAIN}]]></textFieldExpression>

</textField>

</band>

</title>

<pageHeader>

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

</band>

</pageHeader>

<columnHeader>

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

</band>

</columnHeader>

<detail>

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

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

mode="Opaque"

x="0"

y="0"

width="400"

height="10"

forecolor="#000000"

backcolor="#66FFFF"

key="textField"

stretchType="RelativeToBandHeight"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="true"

isPrintWhenDetailOverflows="true"/>

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

<font reportFont="Arial_Bold"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{K_DOMAIN}+ ": "+$F{K_LOGIN}]]></textFieldExpression>

</textField>

<staticText>

<reportElement

mode="Opaque"

x="12"

y="13"

width="400"

height="10"

forecolor="#000000"

backcolor="#FFFFFF"

key="staticText-1"

stretchType="RelativeToBandHeight"

positionType="Float"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="true"/>

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

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

</textElement>

<text><![CDATA[PRUEBA PARA VER TEXTO ESTATICO EN SUBREPORT]]></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>

 

THANKS FOR YOUR TIME AND YOUR HELP

 

 

 

 

 

 

 

By: Diego - pirlango

RE: subreport not shown & log

2004-10-25 06:55

Forgot to say I'm using version 0.6.1

 

 

 

 

By: Diego - pirlango

RE: subreport not shown & log

2004-10-25 11:09

More info:

 

I think subreport is not even called, because a malformed sql query in subreport is not throwing an exception, as it does calling the subreport alone.

 

So the problem must be in calling the subreport in the detail section of master report, but still can't see what the problem is.

 

Again, any info about getting any log information of what is happenning inside jasperreports would be appreciated

 

Thanks again

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