Jump to content
Changes to the Jaspersoft community edition download ×

problemes with subreport : multi-thread...


Recommended Posts

By: loicChapron - chapronloic

problemes with subreport : multi-thread...

2006-06-23 06:57

My problems is that i have a report with 4 level of subreport in like:

A,B,C,D are javaObject

A has many B which have many C which have many D

When i have build my jasperReportObject and when i try to compile the jasperReport. He work without stop.

When i debug, i just have information that he stop... or loop in the method: fillReport()

Is there everybody whose have work on succession of subreport yet.

I'm not sure but i think i have some problems with multi-thread

 

 

By: vertebreaker - vertebreaker

RE: problemes with subreport : multi-thread..

2006-06-26 09:55

A contains some subreports, one is B.

B contains C, and C contains D.

This is working...although it´s tedious.

 

Hope this helps.

 

A===============================================================

CursoEstructura contains some subReports, one of them PlanEstudios

 

<jasperReport name="CursoEstructura" language="java" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="595" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">

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

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

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

<parameter name="titulo_reporte" class="java.lang.String">

</parameter>

<parameter name="usuario" class="java.lang.String">

</parameter>

<parameter name="directorio_base" class="java.io.File">

</parameter>

<parameter name="curso_nombre" class="java.lang.String">

</parameter>

<parameter name="materias" class="java.util.List">

</parameter>

<parameter name="esquema" class="java.util.List">

</parameter>

<parameter name="detallesCurso" class="java.util.List">

</parameter>

<group name="Indice" isStartNewColumn="true" isStartNewPage="true">

<groupHeader>

<band height="842">

<subreport>

<reportElement positionType="Float" x="0" y="0" width="515" height="842" isRemoveLineWhenBlank="true"/>

<subreportParameter name="directorio_base">

<subreportParameterExpression><![CDATA[$P{directorio_base}]]></subreportParameterExpression>

</subreportParameter>

<subreportParameter name="no_footer">

<subreportParameterExpression><![CDATA[new java.lang.Boolean(true)]]></subreportParameterExpression>

</subreportParameter>

<subreportParameter name="titulo_reporte">

<subreportParameterExpression><![CDATA[$P{titulo_reporte}]]></subreportParameterExpression>

</subreportParameter>

<subreportParameter name="curso_nombre">

<subreportParameterExpression><![CDATA[$P{curso_nombre}]]></subreportParameterExpression>

</subreportParameter>

<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{materias})]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{directorio_base}+"/CursoIndicePlanEstudios.jasper"]]></subreportExpression>

</subreport>

</band>

</groupHeader>

</group>

<group name="PlanEstudios" isStartNewPage="true">

<groupHeader>

<band height="842">

<subreport>

<reportElement positionType="Float" x="0" y="0" width="515" height="842" isRemoveLineWhenBlank="true"/>

<subreportParameter name="directorio_base">

<subreportParameterExpression><![CDATA[$P{directorio_base}]]></subreportParameterExpression>

</subreportParameter>

<subreportParameter name="no_footer">

<subreportParameterExpression><![CDATA[new java.lang.Boolean(true)]]></subreportParameterExpression>

</subreportParameter>

<subreportParameter name="titulo_reporte">

<subreportParameterExpression><![CDATA[$P{titulo_reporte}]]></subreportParameterExpression>

</subreportParameter>

<subreportParameter name="curso_nombre">

<subreportParameterExpression><![CDATA[$P{curso_nombre}]]></subreportParameterExpression>

</subreportParameter>

<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{materias})]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{directorio_base}+"/CursoPlanEstudios.jasper"]]></subreportExpression>

</subreport>

</band>

</groupHeader>

</group>

</jasperReport>

 

B===============================================================

PlanEstudios contains MateriaTemas

 

<jasperReport name="CursoPlanEstudios" language="java" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="515" leftMargin="40" rightMargin="40" topMargin="20" bottomMargin="20">

<property name="com.jasperassistant.designer.Locale" value="es_EC"/>

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

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

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

<parameter name="titulo_reporte" class="java.lang.String">

</parameter>

<parameter name="usuario" class="java.lang.String">

</parameter>

<parameter name="directorio_base" class="java.io.File">

</parameter>

<parameter name="curso_nombre" class="java.lang.String">

</parameter>

<parameter name="no_footer" class="java.lang.Boolean">

</parameter>

<field name="codigo" class="java.lang.String">

</field>

<field name="nombre" class="java.lang.String">

</field>

<field name="totalHoras" class="java.lang.Double">

</field>

<field name="temasDeEstudio" class="java.util.List">

</field>

<variable name="totalHoras" class="java.lang.Double" calculation="Sum">

<variableExpression><![CDATA[$F{totalHoras}]]></variableExpression>

</variable>

<title>

<band>

</band>

</title>

<pageHeader>

<band height="120">

...............

</band>

</pageHeader>

<detail>

<band height="647">

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="75" y="5" width="440" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Times New Roman" size="12" pdfFontName="Times-Roman"/>

</textElement>

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

</textField>

<staticText>

<reportElement positionType="Float" x="10" y="5" width="65" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[MATERIA:]]></text>

</staticText>

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="75" y="25" width="440" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Times New Roman" size="12" pdfFontName="Times-Roman"/>

</textElement>

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

</textField>

<staticText>

<reportElement positionType="Float" x="10" y="25" width="65" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[CÓDIGO:]]></text>

</staticText>

<staticText>

<reportElement positionType="Float" x="10" y="45" width="65" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>

</textElement>

<text><![CDATA[HORAS:]]></text>

</staticText>

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="75" y="45" width="30" height="20"/>

<textElement verticalAlignment="Middle">

<font fontName="Times New Roman" size="12" pdfFontName="Times-Roman"/>

</textElement>

<textFieldExpression class="java.lang.Double"><![CDATA[$F{totalHoras}]]></textFieldExpression>

</textField>

<subreport>

<reportElement positionType="Float" x="0" y="70" width="515" height="15" isRemoveLineWhenBlank="true"/>

<subreportParameter name="directorio_base">

<subreportParameterExpression><![CDATA[$P{directorio_base}]]></subreportParameterExpression>

</subreportParameter>

<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{temasDeEstudio})]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{directorio_base}+"/MateriaTemas.jasper"]]></subreportExpression>

</subreport>

</band>

</detail>

<pageFooter>

<band height="35">

<line>

<reportElement x="1" y="5" width="515" height="1">

<printWhenExpression><![CDATA[new java.lang.Boolean($P{no_footer}==null)]]></printWhenExpression>

</reportElement>

<graphicElement/>

</line>

</band>

</pageFooter>

<summary>

<band>

</band>

</summary>

</jasperReport>

 

C===============================================================

PlanEstudios contains MateriaTemas

 

<jasperReport name="MateriaTemas" language="java" pageWidth="595" pageHeight="842" columnWidth="595" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">

<property name="com.jasperassistant.designer.Locale" value="es_EC"/>

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

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

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

<parameter name="directorio_base" class="java.io.File">

</parameter>

<field name="titulo" class="java.lang.String">

</field>

<field name="horasTeoricas" class="java.lang.Double">

</field>

<field name="horasPracticas" class="java.lang.Double">

</field>

<field name="subTemas" class="java.util.List">

</field>

<title>

<band>

</band>

</title>

<pageHeader>

<band height="15">

......................

</band>

</pageHeader>

<detail>

<band height="40">

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="400" y="4" width="50" height="15"/>

<textElement textAlignment="Right">

<font fontName="Times New Roman" size="12" pdfFontName="Times-Roman"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{horasTeoricas}+"h"]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="0" y="4" width="45" height="15"/>

<textElement textAlignment="Right">

<font fontName="Times New Roman" size="10" pdfFontName="Times-Roman"/>

</textElement>

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

</textField>

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="450" y="4" width="50" height="15"/>

<textElement textAlignment="Right">

<font fontName="Times New Roman" size="12" pdfFontName="Times-Roman"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{horasPracticas}+"h"]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="100" y="4" width="300" height="15"/>

<textElement>

<font fontName="Times New Roman" size="10" isBold="true" pdfFontName="Times-Bold"/>

</textElement>

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

</textField>

<subreport>

<reportElement positionType="Float" x="0" y="24" width="515" height="15" isRemoveLineWhenBlank="true"/>

<subreportParameter name="numeroTema">

<subreportParameterExpression><![CDATA[$V{REPORT_COUNT}]]></subreportParameterExpression>

</subreportParameter>

<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{subTemas})]]></dataSourceExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{directorio_base}+"/MateriaSubTemas.jasper"]]></subreportExpression>

</subreport>

</band>

</detail>

<pageFooter>

<band>

<elementGroup>

</elementGroup>

</band>

</pageFooter>

<summary>

<band>

</band>

</summary>

</jasperReport>

 

 

D===============================================================

MateriaTemas contains MateriaSubTemas

 

<jasperReport name="MateriaSubTemas" language="java" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="595" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">

<property name="com.jasperassistant.designer.Locale" value="es_EC"/>

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

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

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

<parameter name="numeroTema" class="java.lang.Integer">

</parameter>

<field name="titulo" class="java.lang.String">

</field>

<title>

<band>

</band>

</title>

<pageHeader>

<band>

</band>

</pageHeader>

<detail>

<band height="15">

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="50" y="0" width="40" height="15"/>

<textElement textAlignment="Right">

<font fontName="Times New Roman" size="10" pdfFontName="Times-Roman"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{numeroTema}.toString()+"."+$V{REPORT_COUNT}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="100" y="0" width="300" height="15"/>

<textElement>

<font fontName="Times New Roman" size="10" pdfFontName="Times-Roman"/>

</textElement>

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

</textField>

</band>

</detail>

<pageFooter>

<band>

<elementGroup>

</elementGroup>

</band>

</pageFooter>

<summary>

<band>

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

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