Jump to content
We've recently updated our Privacy Statement, available here ×

Problem with JSP and charts


2005 IR Help

Recommended Posts

By: duhu - duhu

Problem with JSP and charts

2004-12-13 09:26

I have made a report with iReport and it runs OK both in iReports and inside a JSP, but when I add a chart to the report and run it from a JSP page, it throws an exception although it runs still in iReport. The exception is the following:

 

rg.apache.jasper.JasperException: Error evaluating expression : image_1

Source text : (java.awt.Image)it.businesslogic.ireport.chart.DefaultChartFactory.drawChart(new String[]{"chartName=Pie3D","depthFactor=0.2","titlePosition=1","width=358","plotBackground=[255,255,255]","serie1=SERIE_numeros","serie0=SERIE_nombres","chartBackground=[255,255,255]","tooltips=false","foregroundAlpha=0.33","title=","subtitle=","legend=false","quality=2","height=232","antialias=true"}, (it.businesslogic.ireport.IReportScriptlet)$P{REPORT_SCRIPTLET})

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)

 

the code of my JSP is

 

File reportFile = new File(application.getRealPath("/reports/prueba.jasper"));

JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath());

Map parameters = new HashMap();

Context context = new InitialContext();

DataSource dataSource =(DataSource)context.lookup("java:jdbc/prueba");

Connection conexion = dataSource.getConnection();

 

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,conexion);

JRHtmlExporter exporter = new JRHtmlExporter();

 

StringBuffer sbuffer = new StringBuffer();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);

 

 

exporter.exportReport();

 

 

 

 

By: duhu - duhu

RE: Problem with JSP and charts

2004-12-14 09:12

ok, now I pass to the report an instance of the scriptlet class and I get the following error:

 

org.apache.jasper.JasperException: Error loading scriptlet class : pruebaScriptlet

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)

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

 

(...)

any idea??

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