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

peterramesh

Members
  • Posts

    9
  • Joined

  • Last visited

peterramesh's Achievements

Rookie

Rookie (2/14)

  • First Post Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Got it worked by referring this URL. http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=24445&catid=8&limit=6&limitstart=0 Steps: Code: 1. Replaced jasperreports-x.x.x.jar with jasperreports-x.x.x-javaflow.jar 2. Copied the jasperreports-javaflow.properties from demosamplessubreport and replaced the file name as jasperreports.properties 3. Added the following parameter inside the <subreport> section <parametersMapExpression><![CDATA[new HashMap($P{REPORT_PARAMETERS_MAP})]]></parametersMapExpression> Thanks and Regards Rameshkumar Ramasamy. Post edited by: peterramesh, at: 2007/08/02 15:35
  2. I am facing the same issue (JasperReports 1.3.4 & iReport 2.0), but there was a built-in parameter named "HIBERNATE_SESSION" in subreport. So how to avoid this. Any help is greatly appreciated. Thanks and Regards Rameshkumar Ramasamy. Post edited by: peterramesh, at: 2007/08/02 13:03
  3. lucianc, thanks for your reply. Great! it worked. Rameshkumar Ramasamy
  4. Thanks for the reply. I did try to get access to the session from the spring session factory and passed it to the JRHibernateQueryExecuter within the parameters map. But i ended up getting a ClassCastException. The following is what i tried, Parameter Map: Code: parameters.put(JRHibernateQueryExecuterFactory.PARAMETER_HIBERNATE_SESSION,session); JRHibernateQueryExecuter: Code:[code] JRHibernateQueryExecuter qExe = new JRHibernateQueryExecuter( jasperDesign.getMainDataset(), parameters); Result Was: Code:[code]Exception in thread "main" java.lang.ClassCastException: org.hibernate.impl.SessionImpl at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter.getValueParameter(JRAbstractQueryExecuter.java:178) at net.sf.jasperreports.engine.query.JRAbstractQueryExecuter.getParameterValue(JRAbstractQueryExecuter.java:145) at net.sf.jasperreports.engine.query.JRHibernateQueryExecuter.<init>(JRHibernateQueryExecuter.java:103) at com.example.jasper.example.performReport(ReportWithJoins.java:76) I also digged into the JRHibernateQueryExecuter and JRAbstractQueryExecuter, where in the getParameterValue is casting the parameter to JRFillParameter and causing the above cast exception. Is there any way to wrap the session into the JRFillparameter ( the constructor is protected ). Or am i doing completely wrong?. Any help would be greatly appreciated ! Thanks and Regards Ramesh.
  5. Hi, I guess, the applicationContext.xml is incorrect. It is better to post the complete error log. Rameshkumar Ramasamy.
  6. Hi all, I am a newbie to JasperReport. In our project we are using Spring 2.0.2, Hibernate 3.1 and JasperReports 1.3.4 On Report generation, I keep the HQL query in JasperReport template. Is there ways to inject the applicationContext.xml file? if so, I can use the spring loaded hibernate session instead of standard Hibernate session. I would like to know, how can i pass the following sessionFactory bean of applicationContext.xml to JasperReport engine. Code: <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="namingStrategy"> <ref bean="namingStrategy" /> </property> <property name="mappingResources"> <list> <value>****.hbm.xml</value> <value>****.hbm.xml</value> ....... </bean> All I am trying is, to load list of beans defined in applicationContext.xml towards to generate reports at one step? Is this possible? please let me know If I'm in wrong track. Any help is greatly appreciated. Rameshkumar Ramasamy.
  7. Hi Martynhiemstra, Thanks for your reply. Since those tho beans (Customer and Study) has associations, I able to get the report by firing a single query using joins. Now, the trick is. I have an ApplicationContext.xml file, which loads a list of hbm.xml files. I need to leverage these set of beans to the suitable datasource of JasperReports. So then, the ReportEngine can use the needfull beans. Is it a valid approach to populate the list of beans to JasperReport, at one shot? Please give some tips or URLs related on this. I looked at the org.springframework.ui.jasperreports.JasperReportsUtils class, but this may not be suitable for the usage of applicationContext.xml level. Any help is greatly appreciated. Rameshkumar Ramasamy.
  8. Hi all, I'm a newbie to JasperReports, in our application we are using JasperReports 1.3.4, Hibenate 3.1 and Spring 2.0.2. Basically, I like to know the pros and cons of having query in report template and beans. I ran some tests by referring the JasperReport samples. When I pass the datasource with only one bean as list to JasperFillManager, the report was successfully generated.. Here is the piece of code ************* CustomerDAO customerDao = (CustomerDAO) context.getBean("customerDAO"); List customerList = customerDao.findAll(); JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(customerList); .... .... JasperPrint jasperPrint = JasperFillManager.fillReport(CustomerReport.jasper", params, dataSource); ************* But, when I passed more than one beans as follows, it fails with "Error retrieving field value from bean"..here is the code snippet ************* CustomerDAO customerDao = (CustomerDAO) context.getBean("customerDAO"); List customerList = customerDao.findAll(); StudyDAO studyDao = (StudyDAO) context.getBean("studyDAO"); List studyList = studyDao.findAll(); ArrayList list = new ArrayList(); list.add(customerList); list.add(studyList); JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(list); .... .... JasperPrint jasperPrint = JasperFillManager.fillReport(CustomerReport.jasper", params, dataSource); ************* I would like to know, how to pass more than one beans into DataSource. From my understanding, the included beans in datasource is not reachable to the Report generator engine.. Can I have the query inside the bean instead of having in report template, and pass the query list as datasource. Please, give some tips what I am doing wrong..Or Am I in wrong track? Thanks in advance. Rameshkumar Ramasamy
  9. In most of the cases, I end up with "could not execute query using iterate" error, due to wrong query. So, make sure your query is correct.
×
×
  • Create New...