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;