Jump to content
Changes to the Jaspersoft community edition download ×

displaying subreports


Recommended Posts

By: lakshmi prasad mandava - prasadmandava

displaying subreports

2002-08-23 02:44

I designed on master report file, in that master report title heading i am calling 4 subreports. when i am doing like below code

 

 

<subreport isUsingCache="true">

<reportElement positionType="Float" x="0" y="100" width="0" height="0" />

<subreportParameter name="format">

<subreportParameterExpression>

$P{format}

</subreportParameterExpression>

</subreportParameter>

<subreportParameter name="repType">

<subreportParameterExpression>

$P{repType}

</subreportParameterExpression>

</subreportParameter>

<dataSourceExpression>

$P{datasource}

</dataSourceExpression>

 

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

$P{filePath}+"shipmentsfs.jasper"

</subreportExpression>

</subreport>

<subreport isUsingCache="true">

<reportElement positionType="Float" x="0" y="300" width="0" height="0" />

<subreportParameter name="format">

<subreportParameterExpression>

$P{format}

</subreportParameterExpression>

</subreportParameter>

<subreportParameter name="repType">

<subreportParameterExpression>

$P{repDepl}

</subreportParameterExpression>

</subreportParameter>

<dataSourceExpression>

$P{deplDataSource}

</dataSourceExpression>

 

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

$P{filePath}+"depl.jasper"

</subreportExpression>

</subreport>

<subreport isUsingCache="true">

<reportElement positionType="Float" x="0" y="450" width="0" height="0" />

<subreportParameter name="format">

<subreportParameterExpression>

$P{format}

</subreportParameterExpression>

</subreportParameter>

<subreportParameter name="repType">

<subreportParameterExpression>

$P{repStdGmr}

</subreportParameterExpression>

</subreportParameter>

<dataSourceExpression>

$P{gmrDataSource}

</dataSourceExpression>

 

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

$P{filePath}+"stdm000.jasper"

</subreportExpression>

</subreport>

 

when i am doing this i am getting one vertical line and my subreports are displaying one after another like after finishing the first subreport, second sub report has to be adujsted from last line of first subreport. i tried this but it is not doing dynamically.

 

That's i wrote the hieght as been fixed.

To slove this problem what i have to do.

 

thanks

 

 

 

By: lakshmi prasad mandava - prasadmandava

RE: displaying subreports

2002-08-23 04:51

This header of my page

 

csb1022.0297 CSSales mandava

 

--------------------------------------------------

sales TY LY %LY TY LY %LY

-------------------------------------------------

sale1 24 56 2% 56 67 %6

 

Total ------ ---- ----- ---- ---- ------

24 56 4% 56 67 %4

 

Like this i have four subreports. after finishing first subreport, then second subreport has to start in next line. but is not happening with above code.

if first subreport has more than one page, then i could'nt able see second second subreport in second page. i place all the subreports in <title>

</title> section. In second page header is printing properly if the header contains parameter values. i placed above header section also in <title></title>. is there any problem. please help.

 

 

 

By: Teodor Danciu - teodord

RE: displaying subreports

2002-08-23 05:27

 

Hi,

 

There is a problem with your "width" attribute on all

your 4 subreports.

You may set the "height" attribute to zero, because

the subreport will stretch downwards anyhow,

but this is not the same for the "width".

You have to set the correct with for your subreports

so that they appear on your master report.

This is why you have only some vertical lines...

 

I hope this helps.

Teodor

 

 

 

By: lakshmi prasad mandava - prasadmandava

RE: displaying subreports problem

2002-08-23 05:55

| csb1022.0297 CSSales mandava

|

| --------------------------------------------------

| sales TY LY %LY TY LY %LY

| -------------------------------------------------

| sale1 24 56 2% 56 67 %6

|

| Total ------ ---- ----- ---- ---- ------

| 24 56 4% 56 67 %4

 

now my report is displaying like this, how do i remove vertical line.

 

i am not understanding what u re saying, i am sending all master.xml content.

 

could u correct my file, where i am going wrong

 

<?xml version="1.0"?>

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

 

<jasperReport

name="master2"

pageWidth="842"

pageHeight="595"

columnWidth="519"

columnSpacing="0"

leftMargin="40"

rightMargin="40"

topMargin="50"

bottomMargin="50">

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

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

<reportFont name="Arial_Italic" isDefault="false" fontName="Arial" size="12" isItalic="true" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false"/>

<parameter name="datasource" class="dori.jasper.engine.JRDataSource"/>

<parameter name="deplDataSource" class="dori.jasper.engine.JRDataSource"/>

<parameter name="gmrDataSource" class="dori.jasper.engine.JRDataSource"/>

<parameter name="filePath" class="java.lang.String"/>

<parameter name="repDepl" class="java.lang.String"/>

<parameter name="csbName" class="java.lang.String"/>

<parameter name="date" class="java.lang.String"/>

<parameter name="repName" class="java.lang.String"/>

<parameter name="monthName" class="java.lang.String"/>

<parameter name="format" class="java.lang.String"/>

<parameter name="cnvFactor" class="java.lang.String"/>

<parameter name="year" class="java.lang.String"/>

<parameter name="repType" class="java.lang.String"/>

<parameter name="repStdGmr" class="java.lang.String"/>

 

 

<title>

 

<band height="150">

 

<subreport>

<reportElement positionType="Float" x="0" y="0" width="0" height="0" />

<subreportParameter name="format">

<subreportParameterExpression>

$P{format}

</subreportParameterExpression>

</subreportParameter>

<subreportParameter name="repType">

<subreportParameterExpression>

$P{repType}

</subreportParameterExpression>

</subreportParameter>

<dataSourceExpression>

$P{datasource}

</dataSourceExpression>

 

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

$P{filePath}+"shipmentsfs.jasper"

</subreportExpression>

</subreport>

 

<subreport>

<reportElement positionType="Float" x="0" y="2" width="0" height="1" />

<subreportParameter name="format">

<subreportParameterExpression>

$P{format}

</subreportParameterExpression>

</subreportParameter>

<subreportParameter name="repType">

<subreportParameterExpression>

$P{repDepl}

</subreportParameterExpression>

</subreportParameter>

<dataSourceExpression>

$P{deplDataSource}

</dataSourceExpression>

 

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

$P{filePath}+"depl.jasper"

</subreportExpression>

</subreport>

 

<subreport>

<reportElement positionType="Float" x="0" y="4" width="0" height="2" />

<subreportParameter name="format">

<subreportParameterExpression>

$P{format}

</subreportParameterExpression>

</subreportParameter>

<subreportParameter name="repType">

<subreportParameterExpression>

$P{repStdGmr}

</subreportParameterExpression>

</subreportParameter>

<dataSourceExpression>

$P{gmrDataSource}

</dataSourceExpression>

 

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

$P{filePath}+"stdm000.jasper"

</subreportExpression>

</subreport>

 

 

 

</band>

</title>

<pageHeader>

<band height="150">

 

</band>

</pageHeader>

<columnHeader>

<band height="50">

 

</band>

 

</columnHeader>

<detail>

<band height="40">

 

</band>

</detail>

<columnFooter>

<band height="40">

 

</band>

 

</columnFooter>

<pageFooter>

<band height="40">

 

 

 

</band>

</pageFooter>

<summary>

<band height="60">

 

 

</band>

</summary>

 

</jasperReport>

 

please help me. Thanks allot for giving answers for my questions.

 

thanks

 

 

By: Teodor Danciu - teodord

RE: displaying subreports problem

2002-08-23 06:55

 

Hi,

 

What version of JasperReports are you using?

 

I suspect you use a version older than 0.3.3.

 

In this last version, I have removed the default

border around the subreports which I guess is

causing your problem.

 

Teodor

 

 

 

By: lakshmi prasad mandava - prasadmandava

RE: displaying subreports problem

2002-08-23 23:47

This my Page header

csb1022.0297 CSSales mandava

 

This subheader

-------------------------------------

sales TY LY %LY TY LY %LY

---------------------------------------------

This my report

sale1 24 56 2% 56 67 %6

 

Total ------ ---- ----- ---- ---- ------

24 56 4% 56 67 %4

 

Like this i have 4 subreports, if place in <title> section, the next subreport is adjusting dynamically to next page. so in tag i have to keep the subreports. could uou some clue.

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