Jump to content

Subreport auto indentation


hovendal

Recommended Posts

Hi all,

 

First of, I am pretty new to JasperReports, so please bare with me, if I have missed something crucial - but I cant seem to find anything on this issue.

I have a master report, with a subreport with a nested subreport. Pretty straight forward and it all works like a charm, but one thing! For each of the subreports the left margin is moved an inch or so to the right, like when dooing bulletins with more levels:

  • Master
    • Subreport 1
      • Subreport

So my alignments from the master reports Coloumnheader band doesn't really do the trick :) Ofcourse, this is something i am dooing wrong - but what. Here is how I include the subreports (please dont mind the passed variables and or the setting of the new JRBeanDataSource):

The subreports are all placed in the detail band!

 

Thanks alot in advance for your help - it is much appreciated!

Code:
In master report:	<detail>		<band splitType="Stretch" height="50">			<subreport>				<reportElement key="sub_buildings" x="0" y="0" width="497" height="50"/>				<subreportParameter name="REPORT_RESOURCE_BUNDLE">					<subreportParameterExpression><![CDATA[$P{REPORT_RESOURCE_BUNDLE}]]></subreportParameterExpression>				</subreportParameter>				<subreportParameter name="floors">					<subreportParameterExpression><![CDATA[$F{theFloors}]]></subreportParameterExpression>				</subreportParameter>								<dataSourceExpression><![CDATA[new JRBeanCollectionDataSource($F{theBuildings})]]></dataSourceExpression>				<subreportExpression class="java.lang.String"><![CDATA["buildings.jasper"]]></subreportExpression>			</subreport>					</band>	</detail>subreport 1:	<detail>		<band height="25" splitType="Stretch">			<subreport>				<reportElement key="sub_floors" x="0" y="0" width="497" height="25"/>				<subreportParameter name="REPORT_RESOURCE_BUNDLE">					<subreportParameterExpression><![CDATA[$P{REPORT_RESOURCE_BUNDLE}]]></subreportParameterExpression>				</subreportParameter>				<dataSourceExpression><![CDATA[new JRBeanCollectionDataSource($F{floors})]]></dataSourceExpression>				<subreportExpression class="java.lang.String"><![CDATA["floors.jasper"]]></subreportExpression>			</subreport>		</band>	</detail>
Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 3 years later...

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