Jump to content
Changes to the Jaspersoft community edition download ×

Chart Scriptlet - get Group information?


2005 IR Help

Recommended Posts

By: Darren Hartford - binarymonk

Chart Scriptlet - get Group information?

2004-02-10 09:21

Hey all,

Trying to write a scriptlet to generate a report. I'm ordering the report by Group, and for each group there is a $F{storename} field, and a $V{storetotal} value.

 

How do I get each pair of values for each group?

 

Here is an example, but this does not work:

====snip====

public DefaultCategoryDataset dataset = new DefaultCategoryDataset();

public void afterGroupInit(java.lang.String groupName) throws JRScriptletException{

Integer myvalue = (Integer)this.getVariableValue("storetotal");

String myname = (String)this.getFieldValue("storename");

dataset.addValue(myvalue, "1", myname);

}

====snip====

 

 

 

 

 

By: Darren Hartford - binarymonk

RE: Chart Scriptlet - get Group information?

2004-02-11 07:52

Still no feedback.

 

I have the chart to display, but it seems to only work with the 'afterReportInit' - this is run before I can get all the group data.

 

The chart is in the 'TITLE' band if that helps. It almost seems like you need an 'afterReportDone' event to get all the data from the report. Ideas?

-D

 

 

 

 

By: Teodor Danciu - teodord

RE: Chart Scriptlet - get Group information?

2004-02-14 03:44

 

Hi,

 

I don't see why it does not work.

Your dataset should grow with every group.

 

The only thing you need is to use

evaluationTime="Report" for the chart image you have

in the title section and in the image expression you

should make a call to the REPORT_SCRIPTLET object

that would generate the chart for you from the

gathered data set.

 

I hope this helps.

Teodor

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