Jump to content

subdataset and HQL (used in crosstab)


ekappel

Recommended Posts

Hello!

I need to insert a crosstab in my report. Since we use Hibenate and HQL throughout all our reports I definded a subdataset using HQL as well (buildingRecordMonthly.jrxml). The result being an empty output. By switching from HQL to SQL the crosstab works perfectly (buildingRecordMonthly-SQL.jrxml). To check, I also added a subreport using the same HQL query as the subdataset (buildingRecordMonthly_sub.jrxml). The subreport displays the correct data, while the crosstab stays empty.

Are there any known problems concerning subdatasets and HQL.

Thanks in advance

Eduard

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 1 year later...

 ekappel: did you get it working?

lucianc: I have:

 	<subDataset name="Votings">		<parameter name="voterPk" class="java.lang.Long"/>        <parameter name="HIBERNATE_SESSION" class="org.hibernate.Session"/>		<queryString>			<![CDATA[sELECT v.votingCategory.id as catID FROM Voting v WHERE v.voter.pk = $P{voterPk}]]>		</queryString>		<field name="catID" class="java.lang.String"/>	</subDataset>

			<componentElement>				<reportElement x="0" y="25" width="395" height="41"/>				<c:list xmlns:c="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">					<datasetRun subDataset="Votings">						<datasetParameter name="voterPk">							<datasetParameterExpression><![CDATA[$F{voterPk}]]></datasetParameterExpression>						</datasetParameter>						<datasetParameter name="HIBERNATE_SESSION">							<datasetParameterExpression><![CDATA[$P{HIBERNATE_SESSION}]]></datasetParameterExpression>						</datasetParameter>					</datasetRun>					<c:listContents height="41" width="395">						<frame>							<reportElement x="0" y="0" width="393" height="31"/>							<textField>								<reportElement x="12" y="15" width="63" height="16"/>								<textElement textAlignment="Right"/>								<textFieldExpression class="java.lang.String"><![CDATA[$F{catID}]]></textFieldExpression>							</textField>						</frame>					</c:listContents>				</c:list>			</componentElement>

 Any ideas on what can be wrong?



Post Edited by tofa at 06/16/2010 11:56
Link to comment
Share on other sites

  • 3 weeks 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...