Jump to content
JasperReports Library 7.0 is now available ×

need help with subreports


Recommended Posts

By: mozart - mozart_sk8

need help with subreports

2003-10-07 18:03

I'm having problem with implementing my report in subreport. The problem is when I tried run my reports the results will only show my master report however I can't see the result of my subreport.

 

I would really appreciate if you could help me

 

below is my implementation of my reports in xml

 

 

 

 

By: mozart - mozart_sk8

RE: need help with subreports

2003-10-07 18:15

here's my main report

 

<detail>

<band height="100">

 

<subreport isUsingCache="true">

<reportElement x="30" y="0"

width="180" height="20"/>

<connectionExpression>

$P{REPORT_CONNECTION}

</connectionExpression>

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

"PlanBenefit.jasper"

</subreportExpression>

</subreport>

</band>

</detail>

 

 

 

my subreport

 

<?xml version="1.0"?>

<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport

name="PlanBenefit"

pageWidth="595"

pageHeight="842"

columnWidth="555"

leftMargin="20"

rightMargin="20"

topMargin="30"

bottomMargin="30"

whenNoDataType="AllSectionsNoDetail">

<reportFont name="Arial_Details"

isDefault="true" fontName="Arial" size="10"

isBold="false" />

<reportFont name="Arial_Name" isDefault="true"

fontName="Arial" size="10" isBold="false" />

<reportFont name="Arial_Bold" isDefault="true"

fontName="Arial" size="10" isBold="true" />

<reportFont name="Arial_TITLE" isDefault="true"

fontName="Arial" size="20" isBold="true" />

 

<parameter name="ReportTitle"

class="java.lang.String"/>

<parameter name="PLAN_CONTRACT_NO"

class="java.lang.String"/>

<parameter name="BENEFIT_TYPES"

class="java.lang.String"/>

 

<queryString>

<![CDATA[

SELECT *

FROM CONTRACT_PRINTFILE_BENEFITS

WHERE PLAN_CONTRACT_NUM =

( $P!{PLAN_CONTRACT_NO} )

AND BENEFIT_TYPE = ( $P{BENEFIT_TYPES} )

]]></queryString>

 

<field name="BENEFIT_SHORTNAME"

class="java.lang.String"/>

 

<detail>

<band height ="20">

<textField isBlankWhenNull="false">

<reportElement x="30" y = "100"

width="200" height="30"/>

<textElement textAlignment="Left">

<font reportFont="Arial_Details"/>

</textElement>

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

$F{BENEFIT_SHORTNAME}

</textFieldExpression>

</textField>

</band>

</detail>

 

</jasperReport>

 

 

 

*** hope you can help me

 

 

 

 

By: Teodor Danciu - teodord

RE: need help with subreports

2003-10-08 09:16

 

Hi,

 

Does your master report have a query of its own?

If not, or if this query does not return any rows,

then you should place the subreport on a different

report sections in the master because the detail

never gets generated if there are no rows.

 

I hope this helps.

Teodor

 

 

 

 

 

By: mozart - mozart_sk8

RE: need help with subreports

2003-10-08 18:28

tnx for the reply. Actually I have another query for my master report, if I'm going to call my subreports.jasper without of course it works fine but if I'm going to integrate it with my main report the result is null. And I already put my subreports on a diffferent report section.

 

What seems to be the problem with my implementation? Am I missing something?

 

I would really appreciate if you could help me...

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