Hi Henner,

Thank you !!! it works like a charm ;^)
I will write a jasperreports's subreport how-to for wiki ;^)

P.S.:
I was thinking ... it could be useful to add an extension to the tableData and queryData tags to add their displayed value to a jasper reports map object that could be stored into the page or request context. The Jasper report servlet could get the map from that context instead of creating a new one. (processReport method, line 189). So the jr's report could access to all the dbforms' displayed data. Currently I must create a subreport to show a detail field from another table ;^)
Does this thing make sense ?


Luca


Henner Kollmann ha scritto:

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








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