I dont like to have queries in my code but I still want to be able to fill me report using the reports query. Would JREmptyDataSource give empty report. The program right now is using the parameters, my program generates a resultset by executing the queries in my program, then make that into a JRDataSource. After getting the JRDataSource, together with jrxml file, I pass them to a method that generates my byte[].This is the method: public byte[] generatePDFReport(File reportFile, Map parameters, JRDataSource ds) { byte[] bytes = null; try { JasperReport jasperReport = JasperCompileManager.compileReport(reportFile.getPath()); bytes = JasperRunManager.runReportToPdf( jasperReport, parameters, ds); } catch (JRException e) { e.printStackTrace(); } return bytes; } After I get the bytes, I pass it to another method: public void sendToPDFResponse(byte[] bytes){ HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse(); response.setContentType("application/pdf"); sendToResponse(response, bytes); } to publish it in the web. What I want to do now is bypass the method where I get my JRDataSource using my programs query. I want to find a way to just use the query in my xml to get my data and generate byte[]. I saw a method in my JasperManager that have this interface: bytes = JasperRunManager.runReportToPdf( jasperReport, parameters); return bytes; So it uses just the parameters and jasperreport but when I use it it generates just a null byte[].What are the precondition for me to be able to use this method and generate my data? Thanks a lot for helping with this, I'm new to JasperReport but I think it's cool and I want to learn more about it....