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

jamesmuriithiwanja

Members
  • Posts

    1
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by jamesmuriithiwanja

  1. Am generating reports with the following codes but it takes some time to display: try { Connection con =ConnectDB.getMyConnection(); String sql="SELECT * FROM rep5"; Statement st=con.createStatement(); ResultSet rs=st.executeQuery(sql); if(rs.next()) { JasperDesign jd = JRXmlLoader.load("C:\CPIMS\src\cpims\report5.jrxml"); String sql2 = "SELECT Cnt,Nam,Sir,DOD,Gen,Year,Sch,Title FROM rep5"; JRDesignQuery newquery = new JRDesignQuery(); newquery.setText(sql2); jd.setQuery(newquery); JasperReport jss = JasperCompileManager.compileReport(jd); JasperPrint jp = JasperFillManager.fillReport(jss, null, con); JasperViewer.viewReport(jp, false); }else { JOptionPane.showMessageDialog(null,"No records found in the database","",JOptionPane.INFORMATION_MESSAGE); } }catch(Exception ex) { JOptionPane.showMessageDialog(null,ex.getMessage()); }
×
×
  • Create New...