如何将子报表的内容调整到主报表行的高度?

时间:2016-06-10 22:07:49

标签: jasper-reports subreport

我有子报告的报告。 我希望子报告的内容符合主报告的行高,它现在的样子看不到数据,感谢任何建议和帮助

当前报告

Image of current report

预期输出

Image I need the report

我添加了报告代码:

主报告:

<pageHeader>
    <band height="202" splitType="Stretch">
        <staticText>
            <reportElement x="0" y="0" width="212" height="20" uuid="8d97ce27-cc4f-4813-b292-55202465069d"/>
            <textElement>
                <font isBold="true"/>
            </textElement>
            <text><![CDATA[Institución:]]></text>
        </staticText>
        <staticText>
            <reportElement x="0" y="20" width="212" height="20" uuid="f45ce8e7-1d39-4752-bb0a-83be1c82eae4"/>
            <textElement>
                <font isBold="true"/>
            </textElement>
            <text><![CDATA[Nombre Contacto Oficial:]]></text>
        </staticText>
        <staticText>
            <reportElement x="0" y="40" width="212" height="20" uuid="f34cde43-d6dd-4029-a7e8-e41e31811413"/>
            <textElement>
                <font isBold="true"/>
            </textElement>
            <text><![CDATA[Teléfono Contacto Oficial:]]></text>
        </staticText>
        <staticText>
            <reportElement x="0" y="60" width="212" height="20" uuid="cb046b38-1d4b-40f6-8c95-3111b40bc597"/>
            <textElement>
                <font isBold="true"/>
            </textElement>
            <text><![CDATA[Fecha de inicio del plan:]]></text>
        </staticText>
        <staticText>
            <reportElement x="0" y="80" width="212" height="20" uuid="6bb7030a-0c0f-4e6e-b5c2-ad3b0fa23c32"/>
            <textElement>
                <font isBold="true"/>
            </textElement>
            <text><![CDATA[Periodicidad de seguimiento:]]></text>
        </staticText>
        <textField isBlankWhenNull="true">
            <reportElement x="212" y="20" width="1016" height="20" uuid="4122c81b-b031-4883-8bbd-a26be6a7306f"/>
            <textFieldExpression><![CDATA[$F{contacto_oficial}]]></textFieldExpression>
        </textField>
        <textField isBlankWhenNull="true">
            <reportElement isPrintRepeatedValues="false" x="212" y="40" width="1016" height="20" uuid="999a2316-f143-45cd-80c9-0bd421318c18"/>
            <textFieldExpression><![CDATA[$F{telefonos_contacto_oficial}]]></textFieldExpression>
        </textField>
        <textField pattern="dd/MM/YYYY" isBlankWhenNull="true">
            <reportElement x="212" y="60" width="1016" height="20" uuid="4b0d7923-3ab8-4031-b39a-a643aaf5a957"/>
            <textFieldExpression><![CDATA[$F{fecha_inicio}]]></textFieldExpression>
        </textField>
        <textField isBlankWhenNull="true">
            <reportElement x="212" y="80" width="1016" height="20" uuid="2e04c3f7-1cc3-42ca-b423-27450c91430d"/>
            <textFieldExpression><![CDATA[$F{periodicidad_seguimiento}]]></textFieldExpression>
        </textField>
        <textField isBlankWhenNull="true">
            <reportElement x="212" y="0" width="1016" height="20" uuid="156a4093-2be3-491f-8dcb-f0419dffbd64"/>
            <textFieldExpression><![CDATA[$F{nombre}]]></textFieldExpression>
        </textField>
        <staticText>
            <reportElement style="table" mode="Opaque" x="0" y="114" width="180" height="88" forecolor="#FEFEFE" backcolor="#024586" uuid="2f22b8b4-102a-483e-9913-31d66a0fb6c4"/>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font size="14" isBold="true" isItalic="false" isUnderline="false"/>
            </textElement>
            <text><![CDATA[Estrategias]]></text>
        </staticText>
        <staticText>
            <reportElement style="table" mode="Opaque" x="180" y="114" width="193" height="88" forecolor="#FEFEFE" backcolor="#024586" uuid="1e8ee10f-0b18-4576-b850-e9b87d741230"/>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font size="14" isBold="true" isItalic="false" isUnderline="false"/>
            </textElement>
            <text><![CDATA[Subcriterio]]></text>
        </staticText>
        <staticText>
            <reportElement style="table" mode="Opaque" x="514" y="114" width="140" height="88" forecolor="#FEFEFE" backcolor="#024586" uuid="47bc47c4-1a50-4a98-a587-ff2e27b62351"/>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font size="14" isBold="true" isItalic="false" isUnderline="false"/>
            </textElement>
            <text><![CDATA[Actividades]]></text>
        </staticText>
        <staticText>
            <reportElement style="table" mode="Opaque" x="790" y="114" width="152" height="88" forecolor="#FEFEFE" backcolor="#024586" uuid="dfd4ce40-e9f4-4fd0-bcec-2ab8f0ee0c62"/>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font size="14" isBold="true" isItalic="false" isUnderline="false"/>
            </textElement>
            <text><![CDATA[Responsable]]></text>
        </staticText>
        <staticText>
            <reportElement style="table" mode="Opaque" x="942" y="114" width="128" height="88" forecolor="#FEFEFE" backcolor="#024586" uuid="22e42fe4-c8a6-4a2d-8a69-95432a755169"/>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font size="14" isBold="true" isItalic="false" isUnderline="false"/>
            </textElement>
            <text><![CDATA[Presupuesto]]></text>
        </staticText>
        <staticText>
            <reportElement style="table" mode="Opaque" x="1070" y="114" width="158" height="88" forecolor="#FEFEFE" backcolor="#024586" uuid="34835bf1-6e0f-4d30-adad-dd98af2377bc"/>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font size="14" isBold="true" isItalic="false" isUnderline="false"/>
            </textElement>
            <text><![CDATA[Medio de verificación]]></text>
        </staticText>
        <staticText>
            <reportElement style="table" mode="Opaque" x="654" y="160" width="68" height="42" forecolor="#FEFEFE" backcolor="#024586" uuid="df850dcf-980f-49a0-aeff-cde3954e526a"/>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font size="8" isBold="true" isItalic="false" isUnderline="false"/>
            </textElement>
            <text><![CDATA[Fecha. Inicio (mm/año)]]></text>
        </staticText>
        <staticText>
            <reportElement style="table" mode="Opaque" x="722" y="160" width="68" height="42" forecolor="#FEFEFE" backcolor="#024586" uuid="84e0c4cd-6d9e-4e42-a75a-b706a8508677"/>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font size="8" isBold="true" isItalic="false" isUnderline="false"/>
            </textElement>
            <text><![CDATA[Fecha. Fin (mm/anio)]]></text>
        </staticText>
        <staticText>
            <reportElement style="table" mode="Opaque" x="654" y="114" width="136" height="46" forecolor="#FEFEFE" backcolor="#024586" uuid="ff9c2528-4d8f-4fa7-955b-cdb09f8880d6"/>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font size="14" isBold="true" isItalic="false" isUnderline="false"/>
            </textElement>
            <text><![CDATA[Cronograma]]></text>
        </staticText>
        <staticText>
            <reportElement style="table" mode="Opaque" x="373" y="114" width="141" height="88" forecolor="#FEFEFE" backcolor="#024586" uuid="ca182375-44ea-4b3e-a61e-adfd678878bf"/>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font size="14" isBold="true" isItalic="false" isUnderline="false"/>
            </textElement>
            <text><![CDATA[Objetivos]]></text>
        </staticText>
    </band>
</pageHeader>
<detail>
    <band height="25" splitType="Prevent">
        <subreport>
            <reportElement style="table_TH" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="0" width="1228" height="25" isPrintWhenDetailOverflows="true" uuid="694904db-5195-47ad-98e3-2c85ac6bf1d3"/>
            <subreportParameter name="ID_IES">
                <subreportParameterExpression><![CDATA[$P{ID_IES}]]></subreportParameterExpression>
            </subreportParameter>
            <subreportParameter name="ID_FASE_IES">
                <subreportParameterExpression><![CDATA[$F{id_fase_ies}]]></subreportParameterExpression>
            </subreportParameter>
            <subreportParameter name="ID_PROCESO">
                <subreportParameterExpression><![CDATA[$P{ID_PROCESO}]]></subreportParameterExpression>
            </subreportParameter>
            <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
            <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "SubRepEstrategias.jasper"]]></subreportExpression>
        </subreport>
    </band>
</detail>

SubRepEstrategias:

<background>
    <band splitType="Stretch"/>
</background>
<detail>
    <band height="25" splitType="Prevent">
        <textField isStretchWithOverflow="true" isBlankWhenNull="true">
            <reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="180" height="25" isPrintWhenDetailOverflows="true" uuid="6a0df460-caca-4131-933a-3de953d8b353"/>
            <box>
                <pen lineWidth="0.75"/>
                <topPen lineWidth="0.75"/>
                <leftPen lineWidth="0.75"/>
                <bottomPen lineWidth="0.75"/>
                <rightPen lineWidth="0.75"/>
            </box>
            <textElement textAlignment="Left" verticalAlignment="Middle">
                <font isBold="true"/>
                <paragraph leftIndent="5"/>
            </textElement>
            <textFieldExpression><![CDATA[$F{estrategia}]]></textFieldExpression>
        </textField>
        <textField isStretchWithOverflow="true" isBlankWhenNull="true">
            <reportElement stretchType="RelativeToTallestObject" x="180" y="0" width="193" height="25" isPrintWhenDetailOverflows="true" uuid="4515ff6e-1d08-435d-a194-f8b07f6279df"/>
            <box>
                <pen lineWidth="0.75"/>
                <topPen lineWidth="0.75"/>
                <leftPen lineWidth="0.75"/>
                <bottomPen lineWidth="0.75"/>
                <rightPen lineWidth="0.75"/>
            </box>
            <textElement textAlignment="Left" verticalAlignment="Middle">
                <font isBold="true"/>
                <paragraph leftIndent="5"/>
            </textElement>
            <textFieldExpression><![CDATA[$F{subcriterio}]]></textFieldExpression>
        </textField>
        <subreport>
            <reportElement style="table_TH" stretchType="RelativeToTallestObject" x="514" y="0" width="714" height="25" isPrintWhenDetailOverflows="true" uuid="f2499bd4-ee4f-413b-8119-6efb848aeea6"/>
            <subreportParameter name="ID_PLAN_MEJORA">
                <subreportParameterExpression><![CDATA[$F{id_plan_mejora}]]></subreportParameterExpression>
            </subreportParameter>
            <subreportParameter name="ID_FASE_IES">
                <subreportParameterExpression><![CDATA[$F{id_fase_ies}]]></subreportParameterExpression>
            </subreportParameter>
            <subreportParameter name="ID_ESTRATEGIA">
                <subreportParameterExpression><![CDATA[$F{id_estrategia}]]></subreportParameterExpression>
            </subreportParameter>
            <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
            <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "SubRepActividades.jasper"]]></subreportExpression>
        </subreport>
        <subreport>
            <reportElement style="table_TH" stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="373" y="0" width="141" height="25" isPrintWhenDetailOverflows="true" uuid="1be8169b-777e-479e-9fd9-3eebe1ddcc67"/>
            <subreportParameter name="ID_ESTRATEGIA">
                <subreportParameterExpression><![CDATA[$F{id_estrategia}]]></subreportParameterExpression>
            </subreportParameter>
            <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
            <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "SubRepObjetivos.jasper"]]></subreportExpression>
        </subreport>
    </band>
</detail>

SubRepObjetivos:

<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="ListaCriterios" pageWidth="141" pageHeight="25" orientation="Landscape" columnWidth="141" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="a540f8e7-0e02-42b5-9335-afb5f61c07db">
<property name="ireport.zoom" value="2.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>
<parameter name="ID_ESTRATEGIA" class="java.lang.Long"/>
<queryString>
</queryString>
<field name="id" class="java.lang.Long"/>
<field name="descripcion" class="java.lang.String"/>
<detail>
    <band height="25" splitType="Prevent">
        <textField isStretchWithOverflow="true" isBlankWhenNull="true">
            <reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="141" height="25" isPrintWhenDetailOverflows="true" uuid="6a0df460-caca-4131-933a-3de953d8b353"/>
            <box>
                <pen lineWidth="0.75"/>
                <topPen lineWidth="0.75"/>
                <leftPen lineWidth="0.75"/>
                <bottomPen lineWidth="0.75"/>
                <rightPen lineWidth="0.75"/>
            </box>
            <textElement textAlignment="Left" verticalAlignment="Middle">
                <font isBold="true"/>
                <paragraph leftIndent="5"/>
            </textElement>
            <textFieldExpression><![CDATA[$F{descripcion}]]></textFieldExpression>
        </textField>
    </band>
</detail>

SubRepActividades:

<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="ListaCriterios" pageWidth="714" pageHeight="25" columnWidth="714" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="a540f8e7-0e02-42b5-9335-afb5f61c07db">
<property name="ireport.zoom" value="6.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="ID_PLAN_MEJORA" class="java.lang.Long"/>
<parameter name="ID_ESTRATEGIA" class="java.lang.Long"/>
<parameter name="ID_FASE_IES" class="java.lang.Long"/>
<queryString>
</queryString>
<field name="nombre" class="java.lang.String"/>
<field name="fecha_inicio" class="java.sql.Date"/>
<field name="fecha_fin" class="java.sql.Date"/>
<field name="responsable" class="java.lang.String"/>
<field name="presupuesto" class="java.lang.Double"/>
<field name="medio_verificacion" class="java.lang.String"/>
<field name="meta" class="java.lang.String"/>
<background>
    <band splitType="Stretch"/>
</background>
<detail>
    <band height="25" splitType="Stretch">
        <textField isStretchWithOverflow="true" isBlankWhenNull="true">
            <reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="140" height="25" isPrintWhenDetailOverflows="true" uuid="6a0df460-caca-4131-933a-3de953d8b353"/>
            <box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
                <pen lineWidth="0.75"/>
                <topPen lineWidth="0.75"/>
                <leftPen lineWidth="0.75"/>
                <bottomPen lineWidth="0.75"/>
                <rightPen lineWidth="0.75"/>
            </box>
            <textElement verticalAlignment="Middle">
                <font isBold="true"/>
                <paragraph leftIndent="3"/>
            </textElement>
            <textFieldExpression><![CDATA[$F{nombre}]]></textFieldExpression>
        </textField>
        <textField isStretchWithOverflow="true" pattern="MM/yyyy" isBlankWhenNull="true">
            <reportElement stretchType="RelativeToBandHeight" x="140" y="0" width="68" height="25" isPrintWhenDetailOverflows="true" uuid="0d590bc8-d7dc-4285-b067-407bd00e0bb3"/>
            <box>
                <pen lineWidth="0.75"/>
                <topPen lineWidth="0.75"/>
                <leftPen lineWidth="0.75"/>
                <bottomPen lineWidth="0.75"/>
                <rightPen lineWidth="0.75"/>
            </box>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font isBold="true"/>
            </textElement>
            <textFieldExpression><![CDATA[$F{fecha_inicio}]]></textFieldExpression>
        </textField>
        <textField isStretchWithOverflow="true" pattern="MM/yyyy" isBlankWhenNull="true">
            <reportElement stretchType="RelativeToBandHeight" x="208" y="0" width="68" height="25" isPrintWhenDetailOverflows="true" uuid="6a2f229b-3c38-4b24-8419-9e72a6a5fb2a"/>
            <box>
                <pen lineWidth="0.75"/>
                <topPen lineWidth="0.75"/>
                <leftPen lineWidth="0.75"/>
                <bottomPen lineWidth="0.75"/>
                <rightPen lineWidth="0.75"/>
            </box>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font isBold="true"/>
            </textElement>
            <textFieldExpression><![CDATA[$F{fecha_fin}]]></textFieldExpression>
        </textField>
        <textField isStretchWithOverflow="true" isBlankWhenNull="true">
            <reportElement stretchType="RelativeToBandHeight" x="276" y="0" width="152" height="25" isPrintWhenDetailOverflows="true" uuid="be75a2a8-0387-42f2-ad4a-a4c95f847af8"/>
            <box>
                <pen lineWidth="0.75"/>
                <topPen lineWidth="0.75"/>
                <leftPen lineWidth="0.75"/>
                <bottomPen lineWidth="0.75"/>
                <rightPen lineWidth="0.75"/>
            </box>
            <textElement verticalAlignment="Middle">
                <font isBold="true"/>
                <paragraph leftIndent="5"/>
            </textElement>
            <textFieldExpression><![CDATA[$F{responsable}]]></textFieldExpression>
        </textField>
        <textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
            <reportElement stretchType="RelativeToBandHeight" x="428" y="0" width="128" height="25" isPrintWhenDetailOverflows="true" uuid="88c25977-2225-4295-89fa-0f72ae5edeec"/>
            <box>
                <pen lineWidth="0.75"/>
                <topPen lineWidth="0.75"/>
                <leftPen lineWidth="0.75"/>
                <bottomPen lineWidth="0.75"/>
                <rightPen lineWidth="0.75"/>
            </box>
            <textElement textAlignment="Center" verticalAlignment="Middle">
                <font isBold="true"/>
            </textElement>
            <textFieldExpression><![CDATA[$F{presupuesto}]]></textFieldExpression>
        </textField>
        <textField isStretchWithOverflow="true" isBlankWhenNull="true">
            <reportElement stretchType="RelativeToBandHeight" x="556" y="0" width="158" height="25" isPrintWhenDetailOverflows="true" uuid="644d40c8-06f4-4505-a5bf-3d48f15a787b"/>
            <box>
                <pen lineWidth="0.75"/>
                <topPen lineWidth="0.75"/>
                <leftPen lineWidth="0.75"/>
                <bottomPen lineWidth="0.75"/>
                <rightPen lineWidth="0.75"/>
            </box>
            <textElement verticalAlignment="Middle">
                <font isBold="true"/>
                <paragraph leftIndent="5"/>
            </textElement>
            <textFieldExpression><![CDATA[$F{medio_verificacion}]]></textFieldExpression>
        </textField>
    </band>
</detail>

0 个答案:

没有答案