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

ronatartifact

Members
  • Posts

    6
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by ronatartifact

  1. I just downloaded 3.7.5 and tried to run a report that ran under 3.7.4 and I got the error in the consol window with a nice dump and no report. I exited from 3.7.5 and restarted 3.7.4 and the report works fine. It looks like someone broke iReports and released it anyway. I am OK with 3.7.4 for now. I will not upgrade my production systems that produce reports dynamically. I have the report JRXML file if anyone is interested. Unfortunately it does require a database. If I get a chance I will try a report that uses an empty datasource. Ron
  2. We have a simple report that uses an Empty dataset to print certificates with the User's name and the course that they have passed. The calling program extracts the data from the database and passes it as parameters to the report. Seems simple. The accented characters that are passed in are printed as 2 characters that look like they were passed in as UTF-8 and interpreted as something else. The certificate prints the accented characters that are hardcoded in the report correctly so it is not the PDF step that is causing the problem. The rest of the portal application happily deals with French and English all the time. What character set is Jasper Reports expecting in parameters that are passed in to JasperFillManager? If you look at the attached certificate, the person's name is supposed to be Michaël The following is the code. public void printCertificate(String user_full_name, String course_title, String request_lang, String certification_date, MessageContext ctx) { //This debug prints out the user name and course title correctly _log.debug("ws controller trying to print certificate with "+user_full_name+", "+ course_title +", "+ request_lang +", "+ certification_date); PrintCertificateResponse _response = new PrintCertificateResponse(); HashMap<String, String> jasperParameter = new HashMap<String, String>(); HttpServletRequest request = (HttpServletRequest) ctx.get(AbstractHTTPDestination.HTTP_REQUEST); String hostProtocol = request.getScheme(); String reportTemplateName; jasperParameter.put("user_full_name", user_full_name); jasperParameter.put("course_title", course_title); jasperParameter.put("date", certification_date); reportTemplateName="englishCertificate.jrxml"; String templateLocation = request.getSession().getServletContext().getRealPath("/WEB-INF/templates/"+reportTemplateName).toString(); _log.debug("templateLocation="+templateLocation); JasperReport jasperReport; try { JRDataSource datasource = new JREmptyDataSource(); jasperReport = JasperCompileManager.compileReport(templateLocation); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,jasperParameter, datasource); ByteArrayOutputStream baos = new ByteArrayOutputStream(); JasperExportManager.exportReportToPdfStream(jasperPrint, baos); _log.debug("outputstream size="+baos.size()); HttpServletResponse response = (HttpServletResponse) ctx.get(AbstractHTTPDestination.HTTP_RESPONSE); _response.setServiceSuccess("service success"); response.setContentType("application/pdf"); response.setContentLength(baos.size()); ServletOutputStream out1 = response.getOutputStream(); baos.writeTo(out1); } catch (JRException e) { e.printStackTrace(); //_response.setServiceSuccess("service failed "+e.getMessage()); } catch (IOException e) { e.printStackTrace(); } }
  3. I actually found a sample chapter from one of the books on iReports that actually described a good part of the process. http://books.google.ca/books?id=GeLCEnT1VpMC&pg=PA157&lpg=PA157&dq=ireports+jrxmldatasource+example&source=bl&ots=abW5BGl9G2&sig=ncpr7vEI2QZJfOLe3gJSN5d7vE4&hl=en&ei=dn2pSuvhHoqlnQecjvgY&sa=X&oi=book_result&ct=result&resnum=7#v=onepage&q=&f=false I also found an out of date manual which was helpful. http://ireport.sourceforge.net/cap7.html was the most helpful document but it glossed over the key information about how to link up the fields between the sub-reports and the main report. By a bit of testing and reading between the lines, I figured out what the actual code had to be. If it had 2 more sentences and two code fragments, it would have solved my problem at first reading. The sample chapter (first reference above) supplied the information that the last reference lacked. I have attached my working code and data for anyone who finds this thread and wants a working solution. The report is still underconstruction but the bits that are there, work. Post Edited by ronatartifact at 09/11/2009 12:57 Post Edited by ronatartifact at 09/11/2009 15:40
  4. I am trying to draw a purchase order with a few subreports to display things like Bill to and Ship to addresses as well as item lines. I can not figure out how to specify the connection of the data source from the main report to the sub reports in the right way It can not be that complicated but I have not been able to figure it out from the documentation that I have found. Thanks Ron Post Edited by ronatartifact at 09/11/2009 12:21 Post Edited by ronatartifact at 09/11/2009 12:22
×
×
  • Create New...