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

bernardopina

Members
  • Posts

    5
  • Joined

  • Last visited

bernardopina's Achievements

Newbie

Newbie (1/14)

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

Recent Badges

0

Reputation

  1. About 5 minutes ago i solved the puzzle... The problem was that when i did not receive the xpath as a parameter on the servlet, there were no report path seted on the DataSource. All i did was to get the report path from the .jrxml with the line above and set it on the DataSource. The code became this, and now it works perfectly. Thanks A LOT for all the help. =) Code: InputStream inRegistry = (InputStream) new ByteArrayInputStream(xmlRegistry.getBytes()); JasperDesign jasperDesign = JRXmlLoader.load(template); JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); JRXmlDataSource ds = null; if(xPath != null && !xPath.equals("")) { ds = new JRXmlDataSource(inRegistry,xPath); } else { ds = new JRXmlDataSource(inRegistry,jasperReport.getQuery().getText()); } JasperPrint print = JasperFillManager.fillReport(jasperReport, null, ds); return print;
  2. I have already tried to remove the DataSource from the call, and the code became this: print = JasperFillManager.fillReport(jasperReport, parameters); The problem is... With that change, i get a blank report, with no info (static or dinamic).
  3. I made this with still no success: Code:HashMap parameters = new HashMap(); JasperDesign jasperDesign = JRXmlLoader.load(xmlString); JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); parameters.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, JRXmlUtils.parse(xmlString)); print = JasperFillManager.fillReport(jasperReport, parameters, ds);
  4. Unfortunately i have already tried that with no success. When i do what you said, i just got "null" on every field, and still just one register instead of 3. =/
  5. Hey guys, I have a servlet that receives two parameters: Report Name (example.jrxml) and a xml (on text, not on a file). The servlet have to return a compiled report on .pdf extension. The problem is that i am configuring the XPath within the .jrxml, but the report is not being generated correctly. The report is generated only with the first node of three of the XML. See the files attached for more info. Any clue? Thanks! Post Edited by bernardopina at 05/03/2010 19:37
×
×
  • Create New...