Jump to content
Changes to the Jaspersoft community edition download ×

Charts within Java app: Data but no chart


2004 IR Help

Recommended Posts

By: Brent Hale - brenthale

Charts within Java app: Data but no chart

2004-12-21 15:05

Hi,

 

I'm using iReport 0.4.0 with jasperreports 0.6.3 (I copied 0.6.3 into the iReports installation so that both are running the same version...I hope that's OK).

 

I created a report in iReport that has data and a chart in it. It runs fine in iReport. In my java app the report comes up without any errors and the data shows just fine. The chart does not come up.

 

The .jrxml file contains the following line:

 

<imageExpression class="java.awt.Image"><![CDATA[(java.awt.Image)it.businesslogic.ireport.chart.DefaultChartFactory.drawChart(new String[]{"antialias=true","tooltips=false","legend=false","chartName=Pie","plotOrientation=2","foregroundAlpha=0.33","valueLabel=","subtitle=","plotBackground=[255,255,255]","quality=2","height=453","titlePosition=1","chartBackground=[255,255,255]","width=420","depthFactor=0.2","serie1=SERIE_SO_COUNT","serie0=SERIE_ZIP","categoryLabel=","title="}, (it.businesslogic.ireport.IReportScriptlet)$P{REPORT_SCRIPTLET})]]></imageExpression> </image>

 

In my app, I find the scriptlet specified in the .jrxml file and am able to instantiate it just fine. I then put it into the parameters, like so:

 

 

Class clazz = Class.forName(jasperReport.getScriptletClass());

iReportScriptlet = (IReportScriptlet)clazz.newInstance();

if (iReportScriptlet != null) {

parameters.put(JRParameter.REPORT_SCRIPTLET, iReportScriptlet);

}

 

jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, jrDataSource);

 

 

Any clues as to why the chart doesn't show?

Thanks,

Brent

 

 

 

 

 

By: Giulio Toffoli - gt78

RE: Charts within Java app: Data but no chart

2004-12-21 23:14

 

The scriptlet is instanced by JasperReports itself.

Check you have the it.businesslogic.chart.* in your app and all jar to create the chart too.

 

Giulio

 

 

 

 

By: Brent Hale - brenthale

RE: Charts within Java app: Data but no chart

2004-12-22 17:03

Did you mean to type

 

it.businesslogic.ireport.chart.*

 

instead of

 

it.businesslogic.chart.*

 

If so, then yes, its on my classpath. If not...where is it.

 

I take it I can take out my code which instantiates the servlet then. jasperreports will instantiate it for me?

 

Any other ideas then as to why my charts won't display. Instantiating the scriptlet was a guess on my part that the DefaultChartFactory.drawChart() code wasn't seeing the scriptlet. Without any other error messages being thrown I don't know what to look for.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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