josechinese Posted December 11, 2007 Share Posted December 11, 2007 is possible make a report with 2 or more subreports in a same detail and the same band? like that... <detail> <band height="110"> <textField isStretchWithOverflow="true"> <reportElement x="0" y="0" width="400" height="12" forecolor="gray"/> <textElement textAlignment="Left"> <font size="11"/> </textElement> <textFieldExpression class="java.lang.String"> "Código: " + $F{FA_cod_formula_articulo} </textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="0" y="15" width="400" height="12" positionType="Float"/> <textElement textAlignment="Left"> <font size="9"/> </textElement> <textFieldExpression class="java.lang.String"> "Formula: "+ $F{FA_descripcion} </textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="0" y="30" width="400" height="12" positionType="Float"/> <textElement textAlignment="Left"> <font size="9"/> </textElement> <textFieldExpression class="java.lang.String"> "Cantidad: "+ $F{FA_cantidad} </textFieldExpression> </textField> <subreport> <reportElement key="subreport-1" mode="Opaque" x="1" y="45" width="518" isRemoveLineWhenBlank="true" height="20"> <printWhenExpression> <![CDATA[($F{UN_cod_unidad}!=null)? Boolean.TRUE:Boolean.FALSE]]> </printWhenExpression> </reportElement> <subreportParameter name="TituloSubReporte"> <subreportParameterExpression><![CDATA[$P{TituloSubReporte}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="FA_cod_formula_articulo"> <subreportParameterExpression><![CDATA[$F{FA_cod_formula_articulo}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="SubReporteInsumos"> <subreportParameterExpression><![CDATA[$P{SubReporteInsumos}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="SubConsulta"> <subreportParameterExpression><![CDATA["SELECT * from VARFA_variante_formula_articulo WHERE FA_cod_formula_articulo="+ $F{FA_cod_formula_articulo} + "']]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{SubReporte}]]> </subreportExpression> </subreport> <subreport> <reportElement key="subreport-1" mode="Opaque" x="1" y="45" width="518" isRemoveLineWhenBlank="true" height="20"> <printWhenExpression> <![CDATA[($F{UN_cod_unidad}!=null)? Boolean.TRUE:Boolean.FALSE]]> </printWhenExpression> </reportElement> <subreportParameter name="SubConsultaSimple"> <subreportParameterExpression><![CDATA["SELECT * from INSFA_insumos_formula WHERE FA_cod_formula_articulo='"+ $F{FA_cod_formula_articulo} +"'" ]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{SubReporteInsumosSimple}]]> </subreportExpression> </subreport> </band> </detail> where is the error.... Link to comment Share on other sites More sharing options...
Teodor Danciu Posted December 14, 2007 Share Posted December 14, 2007 Hi, Yes, good question: "where is the error?". As you can see in our /demo/samples/subreport sample that we ship with the JR project distribution package, two or any number of subreports can be put in the same band. This might also help:http://www.jasperforge.org/jasperreports/faq.html#FAQ16 I hope this helps.Teodor Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now