Jump to content

visitmathi

Members
  • Posts

    4
  • Joined

  • Last visited

visitmathi's Achievements

Rookie

Rookie (2/14)

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

Recent Badges

0

Reputation

  1. Hi I am having main report . I am using query [select name from users] produces 10 rows. Similarly i am using query in subreport [select age from users]. For Example: select * from users where name={1st person name,2nd person name}. i.e i need to pass 1st person name from mainreport to sub report Any one have idea on this?
  2. I dont know the exact comparions. As for as Jasper Reports is concerned,I-Reports is easy to use & good designer tool for jasper. For both non -technical and technical users it is easy to use. I Report is open source. Easy to access source code. Integrates well in the web application.
  3. This can be resolved by passing sub report connection as parameter and mainreport data as resultset. Code:try{ connection = establishConnection(); connection1 = establishConnection(); System.out.println(connection); System.out.println(connection1); statement = connection.createStatement(); resultSet = statement.executeQuery(query); JRResultSetDataSource resultSetDataSource = new JRResultSetDataSource(resultSet); HashMap<String,Object> jasperParameter = new HashMap<String, Object>(); jasperReport = JasperCompileManager.compileReport("D:\\Mathi_New\\Test-Java\\TestMathi.jrxml"); jasperParameter.put("REPORT_CONNECTION",connection1); System.out.println("Out..1...."); //jasperPrint = JasperFillManager.fillReport(jasperReport,jasperParameter, connection); jasperPrint = JasperFillManager.fillReport(jasperReport,jasperParameter, resultSetDataSource); System.out.println("Out..2...."); JasperExportManager.exportReportToPdfFile(jasperPrint, "D:\\Mathi_New\\Test-Java\\TestMathi.pdf"); resultSet.close(); statement.close(); connection.close(); connection1.close(); }
  4. Hi I am having sub report, which uses database to retrieve values. I am having main report, which is also doing same thing. While we call individually using java code,it works. But when we add subreport in mainreport,it doesnot retrieve value for sub report. Thanks Mathi Code:try{ connection = establishConnection(); System.out.println(connection); statement = connection.createStatement(); resultSet = statement.executeQuery(query); JRResultSetDataSource resultSetDataSource = new JRResultSetDataSource(resultSet); HashMap<String, String> jasperParameter = new HashMap(); jasperReport = JasperCompileManager.compileReport("D:\\Mathi_New\\Test-Java\\TestMathi.jrxml"); jasperParameter.put("SUBREPORT_DIR","D:/Mathi_New/Test-Java/" ); System.out.println("Error1...."); jasperPrint = JasperFillManager.fillReport(jasperReport,jasperParameter, resultSetDataSource); System.out.println("Error2...."); JasperExportManager.exportReportToPdfFile(jasperPrint, "D:\\Mathi_New\\Test-Java\\TestMathi.pdf"); resultSet.close(); statement.close(); connection.close(); }
×
×
  • Create New...