Jump to content

runReportToPdf


mohammad_awadat

Recommended Posts

i am using this way to passing data source and run report as pdf in browser, but give error, but when change JRResultSetdataSource with jdbc connection running very will. i dont know where error 

 

                ResultSet rs = stmt.executeQuery(query);

                JRResultSetDataSource rsds = new JRResultSetDataSource(rs);

                JasperDesign jasperDesign = JRXmlLoader.load(input);

                JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);  

                byte[] bytes = null;

 

                

                      bytes = JasperRunManager.runReportToPdf(jasperReport,parmeter,rsds);

                      

 

                  response.setContentType("application/pdf");

                  response.setContentLength(bytes.length);

 

                  servletOutputStream.write(bytes, 0, bytes.length);

  

 

thanks 

 
Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...