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

[Solved] Multiple subreports


sgarciaf

Recommended Posts

Hi,

I have a main report with 3 subreports. The problem is that only the first subreport is showing. The other two are under the first one...

I have the 3 subreports in the detail of the main subreport. And the three subreports contain lists.

I tried to put on the 2nd and 3rd subreport the position as Float, but then I can see the first and second subreports, but not the 3rd...

 

Thanks for your help.



Post Edited by sgarciaf at 05/25/2010 13:24



Post Edited by sgarciaf at 05/26/2010 07:27
Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

your post has some layout problems... uhm...

for subreports, try to compile it separately...
then , if you haven't a query to do in the main report, set the query as:
select printorder from (
select 1 as printorder from dual
union
select 2 as printorder from dual
union
select 3 as printorder from dual
) sublist
order by sublist.printorder

(if you have Oracle as Db , otherwise use a similar syntax)
then put  the subreports in a band, such us detail band, ad in each one set the print  when expression as:

new Boolean($F{printorder}.intValue()==1) for the first one...
new Boolean($F{printorder}.intValue()==2) for the second one...
and so on...

 

_________________________________________

if it works... give me KARMA points please!    : ) 
_________________________________________

listening: The Chemical Brothers - The Sunshine Underground

 

 

Link to comment
Share on other sites

thanks slow, but your solution doesnt work...

I only can see the 1st and 2nd subreports, and a white page at the end of the report... I have the subreports in "front" position type.

 

I have mysql database, the query is the same?

 

any ideas?

 

Thanks

Link to comment
Share on other sites

have you tried to run the 3° subreport separately?

it works normally?

if it works, try to change the 2° subreport with the 3°...
if it doesn't work properly, then there is something wrong in the subreport... such as dimension, margin etc.

Link to comment
Share on other sites

  • 5 months later...

 HI,

I have created a report which contains 3 subreports.

The first subreport is in the main report and the next two subreports are in this subreport.

The two subreports display graphs.

When I preview each of them individually I get an output, however when I preview the main report the output is only partial and is incomplete.

Kindly help.

Thanks

Link to comment
Share on other sites

Hi,

I have attached the main and first subreport jrxml (code) here.

Also various screenshots of the output.

Screenshots of the output of the main report and then of the first subreport.

I hope it helps.

Thanks.

Code:
<?xml version="1.0" encoding="UTF-8"?><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="newtemp" language="groovy" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="577" leftMargin="9" rightMargin="9" topMargin="0" bottomMargin="0" isSummaryWithPageHeaderAndFooter="true">	<property name="ireport.zoom" value="1.0"/>	<property name="ireport.x" value="0"/>	<property name="ireport.y" value="0"/>	<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">		<defaultValueExpression><![CDATA["C:\Documents and Settings\germinait\Desktop\Folder\iReport\"]]></defaultValueExpression>	</parameter>	<queryString>		<![CDATA[sELECT     airtel.`Company` AS airtel_Company,     airtel.`Rating` AS airtel_Rating,     sales.`Company` AS sales_Company,     sales.`year` AS sales_year,     sales.`sale` AS sales_saleFROM     `airtel` airtel,     `sales` sales]]>	</queryString>	<field name="airtel_Company" class="java.lang.String"/>	<field name="airtel_Rating" class="java.math.BigDecimal"/>	<field name="sales_Company" class="java.lang.String"/>	<field name="sales_year" class="java.math.BigDecimal"/>	<field name="sales_sale" class="java.math.BigDecimal"/>	<background>		<band splitType="Stretch"/>	</background>	<title>		<band height="28" splitType="Stretch">			<staticText>				<reportElement x="245" y="0" width="91" height="24"/>				<textElement textAlignment="Center">					<font fontName="Arial" size="20" isBold="false" isItalic="false" isUnderline="true"/>				</textElement>				<text><![CDATA[Report]]></text>			</staticText>		</band>	</title>	<pageHeader>		<band height="35" splitType="Stretch"/>	</pageHeader>	<columnHeader>		<band splitType="Stretch"/>	</columnHeader>	<detail>		<band splitType="Stretch"/>	</detail>	<columnFooter>		<band splitType="Stretch"/>	</columnFooter>	<pageFooter>		<band height="55" splitType="Stretch">			<textField>				<reportElement x="443" y="35" width="80" height="20"/>				<textElement textAlignment="Right"/>				<textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>			</textField>			<textField evaluationTime="Report">				<reportElement x="523" y="35" width="40" height="20"/>				<textElement/>				<textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>			</textField>		</band>	</pageFooter>	<summary>		<band height="46" splitType="Stretch">			<subreport>				<reportElement x="0" y="0" width="40" height="42"/>				<dataSourceExpression><![CDATA[]]></dataSourceExpression>				<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "newtemp_subreport2.jasper"]]></subreportExpression>			</subreport>		</band>	</summary></jasperReport>

Post Edited by hedges at 11/18/2010 09:41
Link to comment
Share on other sites

  • 10 months later...

 
 /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif  

 
Thank You So much
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...