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

komal

Members
  • Posts

    10
  • Joined

  • Last visited

komal's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. HI, Im trying to exports jasperreports with two capabilities ie.PDF and XLS, which works fine with Chrome , but not in firefox, in firefox there are no exceptions while exporting a report. Following are the jars im using for jasper reports,commons-beanutils-1.8.0.jarcommons-codec-1.3.jarcommons-collections-3.2.1.jarcommons-digester-1.7.jarcommons-httpclient-3.1.jariText-2.1.0.jarjasperreports-3.5.3.jarjdo2-api-2.3-ea.jarpoi-3.2-FINAL-20081019.jar, Code:following is the code snippet used for exportif (exportType.equals(ExportType.pdf)) { JasperPrint jasperPrint = (JasperPrint) httpSession.getAttribute("jasperprint"); JasperExportManager.exportReportToPdfStream(jasperPrint, byteArray); response.setContentType("application/pdf"); } else if (exportType.equals(ExportType.xls)) { JasperPrint jasperPrint = (JasperPrint) httpSession.getAttribute("jasperprint"); JRXlsExporter exporterXLS = new JRXlsExporter(); exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint); exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, byteArray); exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE); exporterXLS.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE); exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE); exporterXLS.exportReport(); response.setContentType("application/vnd.ms-excel"); }response.setContentLength(byteArray.size()); response.addHeader("Content-Disposition", "Report Download"); ServletOutputStream outs = response.getOutputStream(); outs.write(byteArray.toByteArray()); outs.flush(); outs.close();
  2. hey thanks rmukkamalla your reply helped a lot :):):)
  3. Hi, I have to report for displaying all fixed issues: I am having Issue hibernate bean and Issue Status as a child to the Issue So I say (from Issue where issueStatus.id = 1) and in the report I want to display the issue status value fixed like this Issue.contextId | Issue.name | Issue.description | Issue.issueStatus.name but the Issue.issueStatus.name does not get displayed on the report.... Is it related to fetching the value from the child object in hibernate ? As the other values are getting displayed properly except the issueStatus.name value.. Please tell me where i am wrong and how the value can displayed? thanks, Komal
  4. Hi, I am having a description field which would have like large content of data..(500-1000) characters but when we give a width to the field the text appears cut as it does not wrap. Want the full description to be seen, but the description field should like grow in height if content is more. Is this possible ? Please let me know how it can be done? thanks, Komal
  5. Hi, I would like to have different reports to be combined in one report. eg.would like to a report which allows to get all items that are marked new All new tasks.... All new issues... All new stories... These should appear one below other in a single report.. Is it possible if these are independent reports and are set as subreports under one Master report? Please let me know how I can go about this... thanks, Komal
  6. Thanks Lucian :) That was a big help... I am also facing this problem where the reports are visible and filled when they are deployed on the linux machine. but the same the report are showing count of records on that report but the rows are blank.. Is this a issues.. or some css issues ? not able to find what is the problem..? I have attached a screen shot of both the files from linux war and windows war..
  7. I am still not able to find why the reports remain empty when I pass the query as JRHibernateQueryExecuterFactory.QUERY_LANGUAGE_HQL parameter..and the issue with the JRBeanCollectionDataSource with my type of query. but this did work and the reports get populated... JRDesignQuery newQuery = new JRDesignQuery(); newQuery.setText(theQuery); newQuery.setLanguage("hql") jasperDesign.setQuery(newQuery); JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); but I am facing issues when I include a field from a nested bean in the report the colunm headervalues do not appear in this case. does any one know what is the issue. Thanks,Komal
  8. Hi, I have to generate reports whose query require addition of runtime constraints. and I am using hibernate. I have tried the following.. parameters.put(JRHibernateQueryExecuterFactory.QUERY_LANGUAGE_HQL, "select distinct( Issues1.id) as Id , Issues1.name as Name , Issues1.description as Description from Issue Issues1 where Issues1.project =" + httpSession.getAttribute("projectId")); parameters.put(JRHibernateQueryExecuterFactory.PARAMETER_HIBERNATE_SESSION, session); also I have tried this... JasperDesign jasperDesign = JasperManager.loadXmlDesign(getServletContext().getResourceAsStream("/report/issues.xml")); String theQuery =" select distinct( Issues1.id) as Id , Issues1.name as Name , Issues1.description as Description from Issue Issues1 where Issues1.project =" + httpSession.getAttribute("projectId"); JRDesignQuery newQuery = new JRDesignQuery(); newQuery.setText(theQuery); jasperDesign.setQuery(newQuery); JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); but this does not work for me... It is not able to populate the report.. while the same query when set statically in the xml file populates the report. Also when I try to use the JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(listOfrecords); it throws an exception for the field Id not found... can any one help providing a working example for such a problem.. thanks, Komal
  9. Hi, I want to pass the hql query as a parameter ,ie provide a query at runtime ... Please let me know where I`m going wrong... Code:Session session = SchemaManager.getDatabaseSession(); HashMap parameters = new HashMap(); HttpSession httpSession = this.getThreadLocalRequest().getSession(false);parameters.put(JRHibernateQueryExecuterFactory.QUERY_LANGUAGE_HQL, "select distinct( Issues1.id) as Id , Issues1.name as Name , Issues1.description as Description from Issue Issues1 where Issues1.project =" + httpSession.getAttribute("projectId")); parameters.put("enweliblogo", getServletContext().getRealPath("/report/enweliblogo.gif"));parameters.put("enwelibpoweredbylogo", getServletContext().getRealPath("/report/enwelibpoweredbylogo.gif"));parameters.put("ReportTitle", "Using jasper Design");parameters.put("ColumnHeader", "Metaentities"); parameters.put(JRHibernateQueryExecuterFactory.PARAMETER_HIBERNATE_SESSION, session);JasperDesign jasperDesign = JasperManager.loadXmlDesign(getServletContext().getResourceAsStream("/report/issues.xml"));JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters);JasperExportManager.exportReportToPdfFile(jasperPrint, getServletContext().getRealPath("/report/123.pdf"));SchemaManager.releaseSession(session);
×
×
  • Create New...