PHP:子报表未显示在主报表(ireport designer)

时间:2016-10-17 01:44:06

标签: php jasper-reports

我有一个主报表设计,iReport带有一(1)个子报表whitch  包含一(1)个子报告toow;

我整合了PhpJasperLibrary。

当我从php文件调用主报表时,子报表内容未显示。我该怎么办?

如何执行主报告及其子报告?

main.xml中

    <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="report_stat" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="bbdc1c08-db56-417e-be35-e14e42e720ad">
    	<property name="ireport.zoom" value="1.5"/>
    	<property name="ireport.x" value="157"/>
    	<property name="ireport.y" value="157"/>
    	<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
    		<defaultValueExpression><![CDATA["C:\\wamp\\www\\reports\\"]]></defaultValueExpression>
    	</parameter>
    	<queryString>
    		<![CDATA[select * from sample]]>
    	</queryString>
    	<field name="id_sam" class="java.lang.Integer">
    		<fieldDescription><![CDATA[]]></fieldDescription>
    	</field>
    	<field name="libel_sam" class="java.lang.String">
    		<fieldDescription><![CDATA[]]></fieldDescription>
    	</field>
    	<variable name="libel_sam_1" class="java.lang.Integer" resetType="Page" calculation="DistinctCount">
    		<variableExpression><![CDATA[$F{libel_sam}]]></variableExpression>
    	</variable>
    	<background>
    		<band splitType="Stretch"/>
    	</background>
    	<title>
    		<band height="79" splitType="Stretch"/>
    	</title>
    	<pageHeader>
    		<band height="35" splitType="Stretch"/>
    	</pageHeader>
    	<columnHeader>
    		<band height="36">
    			<staticText>
    				<reportElement uuid="44972e96-86d2-40dd-9c3a-2ef3d58983a9" x="0" y="0" width="85" height="36"/>
    				<box>
    					<topPen lineWidth="1.0"/>
    					<leftPen lineWidth="1.0"/>
    					<bottomPen lineWidth="1.0"/>
    					<rightPen lineWidth="1.0"/>
    				</box>
    				<textElement textAlignment="Center" verticalAlignment="Middle">
    					<font size="12" isBold="true" isItalic="true"/>
    				</textElement>
    				<text><![CDATA[Domaines]]></text>
    			</staticText>
    			<staticText>
    				<reportElement uuid="692e1bb5-66c1-4f46-a5e7-02dd35d93676" x="85" y="0" width="100" height="36" backcolor="#C0C0C0"/>
    				<box>
    					<topPen lineWidth="1.0"/>
    					<leftPen lineWidth="1.0"/>
    					<bottomPen lineWidth="1.0"/>
    					<rightPen lineWidth="1.0"/>
    				</box>
    				<textElement textAlignment="Center" verticalAlignment="Middle">
    					<font size="12" isBold="true" isItalic="true"/>
    				</textElement>
    				<text><![CDATA[Savoirs]]></text>
    			</staticText>
    			<staticText>
    				<reportElement uuid="86761251-91ee-4472-b286-9610985a4be2" x="185" y="0" width="115" height="36"/>
    				<box>
    					<topPen lineWidth="1.0"/>
    					<leftPen lineWidth="1.0"/>
    					<bottomPen lineWidth="1.0"/>
    					<rightPen lineWidth="1.0"/>
    				</box>
    				<textElement textAlignment="Center" verticalAlignment="Middle">
    					<font size="12" isBold="true" isItalic="true"/>
    				</textElement>
    				<text><![CDATA[Savoir-faire]]></text>
    			</staticText>
    			<staticText>
    				<reportElement uuid="af7989ad-f1aa-4f3d-ad72-d30566422586" x="300" y="0" width="115" height="36"/>
    				<box>
    					<topPen lineWidth="1.0"/>
    					<leftPen lineWidth="1.0"/>
    					<bottomPen lineWidth="1.0"/>
    					<rightPen lineWidth="1.0"/>
    				</box>
    				<textElement textAlignment="Center" verticalAlignment="Top">
    					<font size="12" isBold="true" isItalic="true"/>
    				</textElement>
    				<text><![CDATA[Compétences]]></text>
    			</staticText>
    			<staticText>
    				<reportElement uuid="af7989ad-f1aa-4f3d-ad72-d30566422586" x="415" y="0" width="140" height="36"/>
    				<box>
    					<topPen lineWidth="1.0"/>
    					<leftPen lineWidth="1.0"/>
    					<bottomPen lineWidth="1.0"/>
    					<rightPen lineWidth="1.0"/>
    				</box>
    				<textElement textAlignment="Center" verticalAlignment="Middle">
    					<font size="12" isBold="true" isItalic="true"/>
    				</textElement>
    				<text><![CDATA[Appréciation de l'enseignant]]></text>
    			</staticText>
    			<staticText>
    				<reportElement uuid="16b946fa-af0e-44f0-a472-5bfd32ef01e3" x="301" y="18" width="20" height="18"/>
    				<textElement textAlignment="Center">
    					<font size="12" isBold="true"/>
    				</textElement>
    				<text><![CDATA[A]]></text>
    			</staticText>
    			<staticText>
    				<reportElement uuid="f98347e3-bdb4-4761-83b9-d7e7461df2a9" x="332" y="18" width="20" height="18"/>
    				<textElement textAlignment="Center">
    					<font size="12" isBold="true"/>
    				</textElement>
    				<text><![CDATA[B]]></text>
    			</staticText>
    			<staticText>
    				<reportElement uuid="5bb014a6-3ccf-43b5-8c36-2c5222b46e2b" x="392" y="18" width="20" height="18"/>
    				<textElement textAlignment="Center">
    					<font size="12" isBold="true"/>
    				</textElement>
    				<text><![CDATA[D]]></text>
    			</staticText>
    			<staticText>
    				<reportElement uuid="fd6ace43-3901-4623-a71a-58f9fc923fa2" x="361" y="18" width="20" height="18"/>
    				<textElement textAlignment="Center">
    					<font size="12" isBold="true"/>
    				</textElement>
    				<text><![CDATA[C]]></text>
    			</staticText>
    			<line>
    				<reportElement uuid="057bf958-3de7-4feb-9f7d-291161a9a1ee" x="301" y="18" width="114" height="1"/>
    			</line>
    			<line>
    				<reportElement uuid="07e2446e-4710-4c62-9bba-c23afe954c31" x="326" y="18" width="1" height="18"/>
    			</line>
    			<line>
    				<reportElement uuid="2e805dd4-5f6d-4a9e-8a26-84680d57e9b2" x="356" y="18" width="1" height="18"/>
    			</line>
    			<line>
    				<reportElement uuid="65fe2ede-c378-487d-946c-f2684cdcd551" x="385" y="18" width="1" height="18"/>
    			</line>
    		</band>
    	</columnHeader>
    	<detail>
    		<band height="29" splitType="Stretch">
    			<textField>
    				<reportElement uuid="7fac254c-1c48-4d73-808a-c187fc3824c8" stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="0" y="0" width="85" height="29" isPrintWhenDetailOverflows="true"/>
    				<box>
    					<pen lineWidth="1.0"/>
    					<topPen lineWidth="1.0"/>
    					<leftPen lineWidth="1.0"/>
    					<bottomPen lineWidth="1.0"/>
    					<rightPen lineWidth="1.0"/>
    				</box>
    				<textElement textAlignment="Center" verticalAlignment="Middle"/>
    				<textFieldExpression><![CDATA[$F{libel_dom}]]></textFieldExpression>
    			</textField>
    			<subreport>
    				<reportElement uuid="8e1a0b6a-783e-476a-b990-88e9fc94267c" x="85" y="0" width="100" height="29"/>
    				<subreportParameter name="ID_DOMAINE">
    					<subreportParameterExpression><![CDATA[$F{id_dom}]]></subreportParameterExpression>
    				</subreportParameter>
    				<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
    				<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "subrep_discipline.jasper"]]></subreportExpression>
    			</subreport>
    			<line>
    				<reportElement uuid="30383bf2-8674-44fa-ba87-8cf97d513d41" stretchType="RelativeToTallestObject" x="356" y="0" width="1" height="29"/>
    			</line>
    			<line>
    				<reportElement uuid="eb541d7a-b0e7-46ee-9450-7c05d776dbf9" stretchType="RelativeToTallestObject" x="385" y="0" width="1" height="29"/>
    			</line>
    			<line>
    				<reportElement uuid="9e2901c5-50d1-4134-85e9-84998f487728" stretchType="RelativeToTallestObject" x="415" y="0" width="1" height="29"/>
    			</line>
    			<line>
    				<reportElement uuid="581f293f-42d6-4b04-a952-61fefa9cbc56" stretchType="RelativeToTallestObject" x="300" y="0" width="1" height="29"/>
    			</line>
    			<line>
    				<reportElement uuid="7bf10094-4e40-47d5-9eba-abb2c50261bd" stretchType="RelativeToTallestObject" x="554" y="0" width="1" height="29"/>
    			</line>
    			<line>
    				<reportElement uuid="ffa96c89-7397-4e15-8e8c-bd11295b4a77" stretchType="RelativeToTallestObject" x="326" y="0" width="1" height="29"/>
    			</line>
    			<line>
    				<reportElement uuid="923e4072-0ea0-4f8b-870b-dcacf5ebfb9d" stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="415" y="28" width="139" height="1" isPrintWhenDetailOverflows="true"/>
    			</line>
    		</band>
    	</detail>
    	<columnFooter>
    		<band height="44" splitType="Stretch"/>
    	</columnFooter>
    	<pageFooter>
    		<band height="54" splitType="Stretch"/>
    	</pageFooter>
    	<summary>
    		<band height="42" splitType="Stretch"/>
    	</summary>
    </jasperReport>

0 个答案:

没有答案