ekappel Posted July 23, 2008 Share Posted July 23, 2008 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 advanceEduard Link to comment Share on other sites More sharing options...
lucianc Posted July 23, 2008 Share Posted July 23, 2008 I'm not aware of any problems that affect subdatasets with HQL queries. Did you passed the value of the HIBERNATE_SESSION parameter to the subdataset?Regards,Lucian Link to comment Share on other sites More sharing options...
tofa Posted June 16, 2010 Share Posted June 16, 2010 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 More sharing options...
lucianc Posted July 1, 2010 Share Posted July 1, 2010 Tofa, use <queryString language="HQL">HTH,Lucian Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now