Jump to content

jvencebi

Members
  • Posts

    2
  • 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 jvencebi

  1. It's alive !!! I found in another thread something to pass the connection as a parameter:

    parameters.put("REPORT_CONNECTION",conn);// conn is a java.sql.Connection object

    and it's working now.

    The thread with the information is in:

    http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=55312

    See you later,

    Juan

    Code:
    Map<String, Object> params = new HashMap<String, Object>();params.put("SUBREPORT_DIR", urreportpathhere);params.put("SUBREPORTDATASOURCE", urdatasourcehere);JasperPrint print =JasperUtil.fillReport(mainreportpath, params, mainreportdatasource);

    Post Edited by jvencebi at 10/05/2010 17:47
  2. Hi everybody !!!

    I have a master report with several subreports. In the subreport properties put the Connection expression as $P{REPORT_CONNECTION} . When the report is run in iReport both reports get data but when the master report is called from a zk controller the master gets data, the subreport does not.

    I found a thread with this same subject in

    http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=11772

    but when the query is deleted in the master report the subreport does not show data in iReport.

    Note: Since we are using zk's jasperreport tag, we had to create a class implementing JRDataSource wich receives the connection and the jasper report .

    Please, help me know if there is a version bug or maybe I'm doing something wrong.

     

    Juan

    Code:
        public ClassImplementingJRDataSource(Connection conn,JasperReport         jasperReport,Map<String ,Object> params){      this.conn = conn;      m_nIdx = -1;      sql = jasperReport.getQuery().getText();      sql = sql.replaceAll("\\$P\\{infoId\\}", params.get("infoId").toString());      sql = sql.replaceAll("\\$P\\{coopType\\}", "'"+params.get("coopType").toString()+"'");    try {      stmt = this.conn.createStatement();            rs = stmt.executeQuery(sql);    } catch (SQLException e) {      e.printStackTrace();    }              }
×
×
  • Create New...