I need help in JasperReport

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top