Jump to content
Changes to the Jaspersoft community edition download ×

probelm with subreport in summary section


Recommended Posts

By: Suneer A - suneer

probelm with subreport in summary section

2003-09-15 06:23

Hi,

 

I am using jasper reports for printing in pdf format. I have a summary section which is quite large. So I put it in a subreport and included in the master report. But, the contents of the subreport are not getting printed. what could be the reason?

The relevent parts of the master and subreports are given below:

 

 

The master report has the following lines for summary part...

 

 

 

<summary>

<band height="780">

<subreport isUsingCache="false">

<reportElement

mode="Transparent"

x="0"

y="20"

width="570"

height="560"

positionType="Float"

isPrintRepeatedValues="false"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="true"/>

 

<parametersMapExpression>$P{REPORT_PARAMETERS_MAP}</parametersMapExpression>

<subreportParameter name="printtexthandler">

<subreportParameterExpression>$P{printtexthandler}</subreportParameterExpression>

</subreportParameter>

<dataSourceExpression>

$P{REPORT_DATA_SOURCE}

</dataSourceExpression>

<subreportExpression class="java.lang.String">

"D:\BeaWebLogic\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\classes\com\cc\reporttemplates\cc_subreport.jasper"

</subreportExpression>

</subreport>

</band>

</summary>

 

 

the subreport has the following lines... even this simple section is also not working...

 

<jasperReport

name="cc_subreport"

pageWidth="595"

pageHeight="842"

columnWidth="555"

leftMargin="20"

rightMargin="20"

topMargin="30"

bottomMargin="30"

isSummaryNewPage="true">

<reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="8" isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<reportFont name="Arial_Normal" isDefault="false" fontName="Arial" size="8" isBold="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<reportFont name="Arial_Big_Normal" isDefault="false" fontName="Arial" size="10" isBold="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<reportFont name="Arial_Big_Bold" isDefault="false" fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<group name="SummaryGrp" minHeightToStartNewPage="10" isStartNewPage="true">

<groupExpression>$V{PAGE_NUMBER}</groupExpression>

<groupHeader>

<band height="80">

<staticText>

<reportElement positionType="Float" mode="Opaque" x="30" y="50" width="60" height="10"/>

<textElement textAlignment="Left">

<font reportFont="Arial_Bold"/>

</textElement>

<text>Title****</text>

</staticText>

</band>

</groupHeader>

<groupFooter/>

</group>

<detail>

<band height="20">

</band>

</detail>

</jasperReport>

 

 

am I missing something? I tried many possibilities, like changing subreport height and band height etc., but not working!! is there a problem with the way I have given mode?

 

Please help!

 

Thanks in advance,

Suneer

 

 

 

 

 

By: Suneer A - suneer

RE: probelm with subreport in summary section

2003-09-16 22:33

I Tried with a simpler master and subreport with the master report having only a group and a summary section. The subreport is included in the master report at two places. One in the <groupFooter> of the master report and then in the <summary> section of the master report.

The subreport is generated as expected in the <groupFooter> section. But in the <summary> section it is giving me a blank page.

Any suggestion why this is happening...

The <subreport> element in both the places are the same except the mode attribute.

 

has anybody have any such experience with subreport summary section?

 

Thanks in advance,

Suneer

 

 

 

 

 

By: Teodor Danciu - teodord

RE: probelm with subreport in summary section

2003-09-28 03:33

 

Hi,

 

Why are you supplying the REPORT_DATA_SOURCE

to your subreport. Are you sure you want to do this?

 

It means that the subreport will take over and

continue to iterate in the master report data source. This could make your master report finish sooner than expected.

 

If you put the subreport in the summary section,

the master report data source has already reached

the last record and the subreport will have nothing

to iterate on. This is why it does not print.

If you want it to print something anyway,

use whenNoDataType="AllSectionsNoDetail" in

your subreport definition.

 

I hope this helps.

Teodor

 

 

 

 

 

By: Suneer A - suneer

RE: probelm with subreport in summary section

2003-10-01 04:27

Hi Teodor,

 

It worked!!

Yes, there was no need for supplying the REPORT_DATA_SOURCE to the subreport.

thanks for pointing it out.

Thank you very much for the advice and spending ur valueable time for this..

 

Suneer

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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