Jump to content
We've recently updated our Privacy Statement, available here ×

subreport sharing REPORT_DATA_SOURCE w master


2005 IR Help

Recommended Posts

By: manniche62 - manniche62

subreport sharing REPORT_DATA_SOURCE w master

2004-12-07 03:21

Posted in another forum with no replies.... please help!

 

I 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

 

 

 

 

By: C-Box - c-box

RE: subreport sharing REPORT_DATA_SOURCE w ma

2004-12-07 23:59

Well I guess you have to build your own datasource.... implementing JRRewindableDataSource and introduce a clone method....

 

look here in one of my posts... https://sourceforge.net/forum/message.php?msg_id=2831405 there I posted my JRFilterableDataSource

 

 

So you could share one Datasource for Master- and SubReport without having just one record in Master and all others in Sub....

 

hth

C-Box

Link to comment
Share on other sites

  • 3 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

 

I'd love to get this code. When I go to the link, I don't have permission to access the message.

 

Can you please post the class code here? I would appreciate it.

 

Thanks so much. -- OOPS never mind. I found it on another post. thank you so much. ;)

Post edited by: kgentile1010, at: 2006/12/01 19:10

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...