Navigation Menu

Skip to content

Commit

Permalink
JasperViewer Method2
Browse files Browse the repository at this point in the history
  • Loading branch information
Safnaj committed Oct 9, 2018
1 parent 61847ce commit d43b5fa
Showing 1 changed file with 20 additions and 0 deletions.
Expand Up @@ -27,4 +27,24 @@ public void setView(JasperPrint print){
node.requestFocus();
//((Stage)())
}

//Method 2
//For Parameterized Custom Query Report..!

public void viewReport(JasperDesign report){

try {
Connection conn = DBConnection.getDBConnection().getConnection();
JasperReport jr = JasperCompileManager.compileReport(report);
JasperPrint jp = JasperFillManager.fillReport(jr,null,conn);
JasperViewer.viewReport(jp,false);

} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (JRException e) {
e.printStackTrace();
}

}

0 comments on commit d43b5fa

Please sign in to comment.