Jump to content
Changes to the Jaspersoft community edition download ×

Error Filling a report


aggelos

Recommended Posts

Hi All,

i'm trying to export a report to xml and html in a web app, when i compile and execute my app in a tomcat 5.5 version and a oracle client 10g version instaled in my pc it's working ok but when i upload into a server whit a tomcat 5.0 version and the local oracle databese instaled, this error is produced when i tray to export a report to html and xls:

2006-10-26 10:22:26 StandardWrapperValve[reporte_excel]: Servlet.service() for s

ervlet reporte_excel threw exception

java.lang.NoClassDefFoundError

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:140)

at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi

ronment.java:62)

at net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGrap

hEnv(JRGraphEnvInitializer.java:58)

at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.jav

a:311)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFi

ller.java:92)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFi

ller.java:74)

at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:

147)

at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:57

)

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillMa

nager.java:402)

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillMa

nager.java:234)

at interfaz.Reporte_Excel.doGet(Reporte_Excel.java:92)

at interfaz.Reporte_Excel.doPost(Reporte_Excel.java:170)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillMa

nager.java:402)

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillMa

nager.java:234)

at interfaz.Reporte_Excel.doGet(Reporte_Excel.java:92)

at interfaz.Reporte_Excel.doPost(Reporte_Excel.java:170)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:157)

icationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:157)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV

alve.ja at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv

eContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav

a:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(Standard

ContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV

alve.ja at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv

 

this is my code:

String cpu = "Reporte_Excel.jasper"; // Reporteador de PC's

String red = "Reporte_Red.jasper"; // Reporteador Equipos RED

String ups = "Reporte_UPS.jasper"; // Reporteador de UPS's

String pt = "Reporte_PT.jasper"; // Reporteador Plantas Tel.

String base = "Reporte_Base.jasper"; // Reporteador Base Cargador

String cargador = "Reporte_Cargador.jasper"; // Reporteador de Cargador

String bateria = "Reporte_Bateria.jasper"; // Reporteador de Baterias

String usr = (String) request.getSession(false).getAttribute(

"usr");

String pass = (String) request.getSession(false).getAttribute(

"pwd");

ruta = (String) request.getParameter("ruta") + "/";

try {

Connection con = Persistencia.getInstance().demeConexion(usr,

pass);

Map parameters = new HashMap(); //Parámetros del Reporte

 

parameters.put("SUBREPORT_DIR", ruta);

 

/* Insertar los Datos en los reportes -----NEXT LINE IS LINE 92 ------*/

JasperPrint jp_CPU = JasperFillManager.fillReport(ruta +

cpu, parameters, con);

JasperPrint jp_RED = JasperFillManager.fillReport(ruta +

red, parameters, con);

JasperPrint jp_UPS = JasperFillManager.fillReport(ruta +

ups, parameters, con);

JasperPrint jp_PT = JasperFillManager.fillReport(ruta +

pt, parameters, con);

JasperPrint jp_BASE = JasperFillManager.fillReport(ruta +

base, parameters, con);

JasperPrint jp_CARGADOR = JasperFillManager.fillReport(ruta +

cargador, parameters, con);

JasperPrint jp_BATERIA = JasperFillManager.fillReport(ruta +

bateria, parameters, con);

File destFile = new File(ruta,

"Listado de Equipos.xls");

JRXlsExporter exporter = new JRXlsExporter();

 

/* Insertar las paginas de los reportes en un solo archivo xls */

int i = 1;

if (jp_RED.getPages().size() > 0) {

jp_CPU.addPage(i, jp_RED.removePage(0));

i = i + 1;

}

if (jp_UPS.getPages().size() > 0) {

jp_CPU.addPage(i, jp_UPS.removePage(0));

i = i + 1;

}

if (jp_PT.getPages().size() > 0) {

jp_CPU.addPage(i, jp_PT.removePage(0));

i = i + 1;

}

if (jp_BASE.getPages().size() > 0) {

jp_CPU.addPage(i, jp_BASE.removePage(0));

i = i + 1;

}

if (jp_CARGADOR.getPages().size() > 0) {

jp_CPU.addPage(i, jp_CARGADOR.removePage(0));

i = i + 1;

}

if (jp_BATERIA.getPages().size() > 0) {

jp_CPU.addPage(i, jp_BATERIA.removePage(0));

i = i + 1;

}

 

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp_CPU);

exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,

destFile.toString());

exporter.setParameter(JRXlsExporterParameter.

IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);

exporter.exportReport();

 

 

 

please...i really need help....

 

THANKS A LOT

 

Viviana

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 weeks later...

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