S
sahm
Hi every one;
I'm trying to call Jasper Report form Java
but in my code when I try to call Jasper Report nothing happen
this is my code
//////////////////////////////////////////////////////////////
try
{
infoClass ipc = new infoClass();
Class.forName("com.mysql.jdbc.Driver");
Connection con;
con = DriverManager.getConnection("jdbc:mysql://" + ipc.ip
+ "/" + ipc.db,ipc.user,ipc.ps);
JOptionPane.showMessageDialog(this, "Massage 2");
JasperReport report;
JOptionPane.showMessageDialog(this, "Massage 3");
report=
JasperCompileManager.compileReport("Department_report.jrxml");
JOptionPane.showMessageDialog(this, "Massage 4");
JasperPrint print = JasperFillManager.fillReport(report,
null,con);
JRViewer viewer = new JRViewer(print);
viewer.setOpaque(true);
viewer.setVisible(true);
}
catch(SQLException se)
{
JOptionPane.showMessageDialog(this, se.toString(), "SQL
Error", JOptionPane.ERROR_MESSAGE);
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this, e.toString(), "Error",
JOptionPane.ERROR_MESSAGE);
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
the code it work until "Massage 3 and stop working
Best
Salim
I'm trying to call Jasper Report form Java
but in my code when I try to call Jasper Report nothing happen
this is my code
//////////////////////////////////////////////////////////////
try
{
infoClass ipc = new infoClass();
Class.forName("com.mysql.jdbc.Driver");
Connection con;
con = DriverManager.getConnection("jdbc:mysql://" + ipc.ip
+ "/" + ipc.db,ipc.user,ipc.ps);
JOptionPane.showMessageDialog(this, "Massage 2");
JasperReport report;
JOptionPane.showMessageDialog(this, "Massage 3");
report=
JasperCompileManager.compileReport("Department_report.jrxml");
JOptionPane.showMessageDialog(this, "Massage 4");
JasperPrint print = JasperFillManager.fillReport(report,
null,con);
JRViewer viewer = new JRViewer(print);
viewer.setOpaque(true);
viewer.setVisible(true);
}
catch(SQLException se)
{
JOptionPane.showMessageDialog(this, se.toString(), "SQL
Error", JOptionPane.ERROR_MESSAGE);
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this, e.toString(), "Error",
JOptionPane.ERROR_MESSAGE);
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
the code it work until "Massage 3 and stop working
Best
Salim