Yes, i use jasperreports with subreports and dbforms. But it's a little bit
tricky.

1. dbforms only passes the data to the main report. Data for subreports must
come from sql statements wich are linked to the masterreport.
2. You must send the connection from the param object to the detailreport -
this is constructed inside dbforms.
   The masterreports REPORT_CONNECTION is'nt defined because data comes from
an dbforms ReportDataObject.

Here is an example:
....
        <parameter name="PARAM" isForPrompting="true"
class="org.dbforms.servlets.reports.ReportParameter"/>
.....
                                <subreport  isUsingCache="true">
                                        <reportElement
                                                mode="Opaque"
                                                x="0"
                                                y="152"
                                                width="515"
                                                height="15"
                                                forecolor="#000000"
                                                backcolor="#FFFFFF"
                                                key="subreport-2"
                                                stretchType="NoStretch"
                                                positionType="Float"
                                                isPrintRepeatedValues="true"
                                                isRemoveLineWhenBlank="true"
        
isPrintInFirstWholeBand="false"
        
isPrintWhenDetailOverflows="false"/>
                                        <subreportParameter  name="ID">
        
<subreportParameterExpression><![CDATA[$F{ID}]]></subreportParameterExpressi
on>
                                        </subreportParameter>
                                        <subreportParameter  name="PARAM">
        
<subreportParameterExpression><![CDATA[$P{PARAM}]]></subreportParameterExpre
ssion>
                                        </subreportParameter>
        
<connectionExpression><![CDATA[$P{PARAM}.getConnection()]]></connectionExpre
ssion>
                                        <subreportExpression
class="java.lang.String"><![CDATA[$P{PARAM}.getReportPath() +
"Artikel_Laengen.jasper"]]></subreportExpression>
                                </subreport>
....

Cheers,
Henner




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to