Jump to content
JasperReports Library 7.0 is now available ×

Class Error


2005 IR Help

Recommended Posts

By: Flavio Giovanni - fgiovanni

Class Error

2004-03-17 07:33

Hello people..

 

I create a Class, but this not inicialize the report. Look the code:

 

 

Code:
public void init() 
{
String sFileName = "http://192.168.200.3:8080/jasper/reports/WebappReport.jasper";
if (sFileName != null)
{
try
{
Class.forName("org.gjt.mm.mysql.Driver"«»);
Connection con = DriverManager.getConnection("jdbc:mysql://192.168.200.3/NewRIPilotoR1SP", "siscart", "bluelau"«»);
HashMap parametros = new HashMap();
String sql_cons = "SELECT * FROM reg_cab WHERE protocolo = 130756";
parametros.put("sql", sql_cons);


jasperReport = (JasperReport)JRLoader.loadObject(new URL(getCodeBase(), sFileName));
jasperPrint = JasperManager.fillReport(jasperReport, parametros, con);
//jasperPrint = JasperFillManager.fillReport(jasperReport, parametros, con);

JasperViewer.viewReport(jasperPrint);
}
catch (Exception e)
{
StringWriter swriter = new StringWriter();
PrintWriter pwriter = new PrintWriter(swriter);
e.printStackTrace(pwriter);
JOptionPane.showMessageDialog(this, swriter.toString());
}
}
else
{
JOptionPane.showMessageDialog(this, "o caminho nã¯foi especificado"«»);
}
}

Post edited by: tcloonan, at: 2006/08/25 05:19

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

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...