mfa Posted November 9, 2007 Share Posted November 9, 2007 hi mastersir i use this code for create the pdf ExternalContext econtext = getExternalContext(); InputStream stream = econtext.getResourceAsStream(PREFIX); try { JRResultSetDataSource mcon = new JRResultSetDataSource(getSessionBean1().getChartofaccRowSet()); JasperPrint jasperPrint = null; jasperPrint = JasperFillManager.fillReport(stream, null, mcon); JRExporter exporter = null; HttpServletResponse response = (HttpServletResponse)econtext.getResponse(); FacesContext fcontext = FacesContext.getCurrentInstance(); exporter = new JRPdfExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, response.getOutputStream());exporter.exportReport(); fcontext.responseComplete(); } catch (Exception ex) { log(" Error Description" , ex); error("Error counting rows: " + ex.getMessage() ); error("Error counting rows: " + ex ); } sir this code not give any error but also not create /display the pdfi try to find the where problem occurred i get textfiled and send some value after one by one line like is this first time try JRResultSetDataSource mcon = new JRResultSetDataSource(getSessionBean1().getChartofaccRowSet());textField2.setValue(PREFIX); is given me right result and show /WEB-INF/reports/mfa.jasper in textfield2 second time jasperPrint = JasperFillManager.fillReport(stream, null, mcon); textField2.setValue(PREFIX); when i press button second time this time page not give me result in textfield2 and show blank it means only this line have error but what i could not foud out jasperPrint = JasperFillManager.fillReport(stream, null, mcon); use see my code and give me idea or solution of my problem thank’saamir Link to comment Share on other sites More sharing options...
martynhiemstra Posted November 12, 2007 Share Posted November 12, 2007 Can you post the error? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now