Jump to content

brouardbas

Members
  • Posts

    9
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Posts posted by brouardbas

  1. Code:
    Thank you for your reply, but I don't want to remove pagination, I want to limit the number of results at 100 for exemple. In SQL, we use instruction "limit 100" but it doesn't exist in hql.

    With hibernate we can just use the instruction query.maxResult(100) but this is JasperReports that manage query execution so I can't use it.

    How do you limit the number of results with JasperReports using hql query ?

    Thank you
  2. hi,

    in my application, I use JasperReports library 4.1.1 to make reporting. I use hibernate connection and hql query. I want display in previewer a single page. So I want JasperReports to fill report on only one page. For that I write following source code :

    But the parameter  code        "parameters.put(JRHibernateQueryExecuterFactory.PROPERTY_HIBERNATE_QUERY_LIST_PAGE_SIZE, 1);" is not read because I have all filled pages.

    I saw in JRXML that the tag "<property name="net.sf.jasperreports.hql.query.list.page.size" value="1"/>" is missing.

     

    Thank for your help.

     

    P.S : sorry for my bad english language

    Code:
     /**     * This method is used to fill a report and to show if an error occurred during the filling     */    public void fillReport()    {        logger.trace("filling of report");        reportPrinted = null;        JasperReport reportCompiled = getReportCompiled();        Session session = HibernateUtil.getSessionFactory().getCurrentSession();        Transaction transaction = session.beginTransaction();        Map<String, Object> reportParameters = getFillingReportParameters(session);        try        {            reportPrinted = JasperFillManager.fillReport(reportCompiled, reportParameters);            logger.trace("filling report done and it contains {} pages", getNumberOfPages());        } catch (JRException e)        {            logger.error("An error is occured while filling of report : {}", LoggerManager.getErrorMessage(e));        }        transaction.rollback();    }    /**     * @param session     *            the hibernate session     * @return the map of filling report parameters     */    private Map<String, Object> getFillingReportParameters(Session session)    {        Map<String, Object> parameters = new HashMap<String, Object>();        parameters.put(JRHibernateQueryExecuterFactory.PARAMETER_HIBERNATE_SESSION, session);        parameters.put(JRHibernateQueryExecuterFactory.PROPERTY_HIBERNATE_QUERY_RUN_TYPE,                       JRHibernateQueryExecuterFactory.VALUE_HIBERNATE_QUERY_RUN_TYPE_LIST);        parameters.put(JRHibernateQueryExecuterFactory.PROPERTY_HIBERNATE_QUERY_LIST_PAGE_SIZE, 1);        return parameters;    }
  3. aparfeno
    Wrote:

    I solved the problem by simply recompiling Jasper against latest hibernate3.jar. No actual code change was necessary.

    The reason is that Hibernate.BOOLEAN (and others) are declared as final, so the compiler "took" their signature when it created original jasperreports.jar.

    I have same problem. How do you recompile Jasper ? Thank you.

     



    Post Edited by brouardbas at 07/05/2011 15:44



    Post Edited by brouardbas at 07/05/2011 15:45
×
×
  • Create New...