Jump to content
Changes to the Jaspersoft community edition download ×

Using a scriplet class in a subreport

2004 IR Help

Recommended Posts

By: Chris - qoviachris

Using a scriplet class in a subreport

2005-08-02 07:33

I am trying to use a scriplet class in my subreport, I have the scriplet class defined in the subreport parameters, as well as all other needed parameters. I see the subreport being printed however the detail band where the chart is located is always empty.


Does anyone know the proper way to have a subreport display a chart?





By: cfi - delphinecfi

RE: Using a scriplet class in a subreport

2005-08-02 09:19

Try this


1. Report properties ->Scriptlet -> Specify the scriplet class

2. Create avariable 'ChartImage'

2. get the buffered image of the chart

3. Set the buffered image of chart to variable 'ChartImage'

4. On the report design choose the image tool properties -> Image properties -> set Image Expression as $V{ChartImage}, Image Espression class - > jva.awt.image


See if this works







By: Chris - qoviachris

RE: Using a scriplet class in a subreport

2005-08-02 10:33

I'm not sure if I am on the right track or not. Below is what I am currently doing.


Inside my scriplet class, I create the chart and set a variable by:


setVariableValue(chartVariableName, new JCommonDrawableRenderer(chart));


Then inside the subreport which i have defined the scriplet class, I have a variable chartVar, which i set to the source for an image component.


This works fine if I do not use a subreport, however when I use a subreport, it appears as if the scriplet is never displayed because there is no data, do I need to define a datasource as well for a chart in a subreport.


The only datasource I have used is the JRRewindable, which I have used for tables but nothing for charts.



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