ktrinad Posted August 20, 2006 Share Posted August 20, 2006 By: manniche62 - manniche62 subreport sharing REPORT_DATA_SOURCE w master 2004-11-24 08:46I have a simple master detail report, the data source is the same; seems that is present only a cursor that share the data among master and sub. I see one record in the master and the remain collaborate to create the sub? Is possible clone the data source? Any idea to solve this problem? Thanks, grazie, merc , gracias ... MASTER: -------------------------------- <?xml version="1.0"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://servizio-stampa.mondadori.it/jasperreport.dtd" [ <!ENTITY testata SYSTEM "file:./fil/Comune/TestataLandscape.xml"> <!ENTITY piede SYSTEM "file:./fil/Comune/PiedeLandscape.xml"> ] > <jasperReport name="DataSourceReport" pageWidth="842" pageHeight="595" columnWidth="762" columnSpacing="0" leftMargin="40" rightMargin="40" topMargin="50" bottomMargin="50"> <reportFont name="Arial_Normal" isDefault="true" fontName="Arial" size="10" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="10" isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <reportFont name="Arial_Italic" isDefault="false" fontName="Arial" size="10" isItalic="true" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <!-- campi per la testata, inizio --> <field name="tCodiceSocieta" class="java.lang.String"/> bla bla bla <variable name="StampatoIl" class="java.util.Date" calculation="System"> <initialValueExpression><![CDATA[new java.util.Date()]]></initialValueExpression> </variable> <variable name="CS" class="net.sf.jasperreports.engine.data.JRTableModelDataSource" calculation="System"> <initialValueExpression><![CDATA[$P{REPORT_DATA_SOURCE}]]></initialValueExpression> </variable> <group name="Distinta" minHeightToStartNewPage="60"> <groupExpression> $F{DistintaCodice} </groupExpression> <groupHeader> <band height="165"> <subreport isUsingCache="true"> <reportElement x="0" y="0" width="500" height="80" backcolor="#99CCFF" positionType="Float" isPrintRepeatedValues="false" isPrintWhenDetailOverflows="false" isRemoveLineWhenBlank="true"/> <subreportParameter name="REPORT_DATA_SOURCE"> <subreportParameterExpression>$V{CS}</subreportParameterExpression> </subreportParameter> <subreportExpression class="java.lang.String"> "fil/Tesoreria/sa_te_be_Distinta_SubTotali.jasper" </subreportExpression> </subreport> <textField> <reportElement x="500" y="0" width="200" height="15"/> <textElement textAlignment="Left"/> <textFieldExpression class="java.lang.String"> $F{tBanca} </textFieldExpression> </textField> bla bla bla </groupHeader> <groupFooter> <band height="180"> </band> </groupFooter> </group> &testata; <pageHeader> </pageHeader> <detail> <band height="60"> <textField> <reportElement x="0" y="4" width="80" height="15"/> <textElement textAlignment="Left"/> <textFieldExpression class="java.lang.String"> $F{DocumentoNumero} </textFieldExpression> </textField> bla bla bla </band> </detail> &piede; </jasperReport> -------------------------------- SUB: -------------------------------- <?xml version="1.0"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="sa_te_be_Distinta_SubTotali" pageWidth="842" pageHeight="595" columnWidth="762" columnSpacing="0" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" whenNoDataType="AllSectionsNoDetail"> <reportFont name="Arial_Normal" isDefault="true" fontName="Arial" size="8" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="8" isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <reportFont name="Arial_Italic" isDefault="false" fontName="Arial" size="8" isItalic="true" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <!-- campi per la testata, inizio --> <field name="tCodiceSocieta" class="java.lang.String"/> bla bla bla <variable name="ImportoPerData" class="java.lang.Float" resetType="Group" resetGroup="DataAddebito" calculation="Sum"> <variableExpression>java.lang.Float.valueOf($F{MandatoImporto})</variableExpression> </variable> <group name="DataAddebito" minHeightToStartNewPage="60"> <groupExpression> $F{MandatoDataAddebito} </groupExpression> <groupHeader> </groupHeader> <groupFooter> <band height="15"> bla bla bla </band> </groupFooter> </group> <detail> </detail> <pageFooter> </pageFooter> <summary> <band height="10"> bla bla bla </band> </summary> </jasperReport> -------------------------------- Thanks and sorry for my poor english, Aldo 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