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

mdhoffman

Members
  • Posts

    3
  • Joined

  • Last visited

mdhoffman'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. This is the first time I've used iReport in an application and I'm trying to load it on my jsp page. I've found a few examples on different sites, but I can't get any of them to work. Right now I have: // Set class path for compiling XML templates ServletContext context; System.setProperty("jasper.reports.compile.class.path",context.getRealPath("/WEB-INF/lib/jasperreports-0.6.1.jar") + System.getProperty("path.separator") + context.getRealPath("C:/Data/Projects/Java/oChequeManager/classes/")); // Specify a default folder for storing // compiled XML templates System.setProperty("jasper.reports.compile.temp",context.getRealPath("C:/java/Jasper/buildTests/")); JasperCompileManager.compileReportToFile(getServletContext().getRealPath("C:/java/Jasper/buildTests/TransactionSearch.xml")); File reportFile = new File(getServletContext().getRealPath("C:/java/Jasper/buildTests/TransactionSearch.jasper")); JasperReport jasperReport = (JasperReport) new JRLoader().loadObject(reportFile.getPath()); JasperPrint jasperPrint = JasperManager.fillReport(jasperReport, new HashMap(), new JREmptyDataSource()); JRHtmlExporter exporter = new JRHtmlExporter(); JRHtmlExporterParameter exporterParameter; exporter.setParameter(exporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(exporterParameter.OUTPUT_WRITER,response.getWriter()); Map imagesMap = new HashMap(); request.getSession().setAttribute("IMAGES_MAP", imagesMap); exporter.setParameter(exporterParameter.IMAGES_MAP, imagesMap); exporter.setParameter(exporterParameter.IMAGES_URI,"image?image="); exporter.exportReport(); I'm getting two errors - a couple of initialization errors and uses or overrides a deprecated API error. If anyone knows of a good way to bring iReports into jsp it would be very helpful.
  2. I'm new to iReport and I'm having problems creating a pie chart. I have a connection with the database and I'm bringing in two fields. These fields are displayed in the detail band and my pie chart is in the summary band. For the chart, my key expression is $F{BUSINESSAREA}, my value expression is $F{PERCENTAGE}, and my label expression is $F{BUSINESSAREA}. Those are my two fields. But all that is displaying in the report is the list of business areas and their percentages from the database and a gray box for the pie chart. Any help with this would be very much appreciated.
  3. I'm new to iReport and I'm having problems creating a pie chart. I have a connection with the database and I'm bringing in two fields. These fields are displayed in the detail band and my pie chart is in the summary band. For the chart, my key expression is $F{BUSINESSAREA}, my value expression is $F{PERCENTAGE}, and my label expression is $F{BUSINESSAREA}. Those are my two fields. But all that is displaying in the report is the list of business areas and their percentages from the database and a gray box for the pie chart. Any help with this would be very much appreciated.
×
×
  • Create New...