Jump to content
Changes to the Jaspersoft community edition download ×

Assistance with Java and/or Scriptlets


rifraser

Recommended Posts

I have a requirement to process two or more datasets, with the results being a combination of the records and fields. Consider the following bill-of-material, which is extracted from the data warehouse using Oracles 'CONNECT BY' select statement.

RownumLevelParentChildQuantity
11Part 1Part 21
22Part 2Part 31
33Part 3Part 42
44Part 4Part 72
51Part 1Part 51
62Part 5Part 61

The processing I need to do is:

- If you find a level 2 part of a particular name, report the next part at level 4 ( you do not know know how many level 3 parts will be below the level 2 part)

- If you find Part 2 in the dataset, report the item of a particular type two levels below (Part 2 can be anywhere in the heriarchy)

The Rownum field can be used to iterate over SQL returned results.

How, within a java or scriptlet class, can you get all the returned records, iterate according to lots of rules that involve forward- and backward- referencing relative to a row,

and output so that the iReport designer just works with one or more rows of data?

As a further challenge, I could have mulitple output datasets from multiple sub reports, and the processing occurs across all the data sets.

ie: If you find Part 1 in dataset 1, report all level 2 parts in data set 2; else report only level 1 data in the third data set.

Note:

I cannot query directly on the data ware house using java or similar, as only the iReport 'Report Datasource' is provided by the central IT resources; I just use it within iReport. The above problem is simple if I could directly access, via JDBC within Java, the data warehouse.

I must use iReport and JasperServer as this is the corporate standard. If I was using BIRT, then I would use the beforeOpen, beforeClose, onFetch, open and fetch scripts to process the data

JasperServer provides the ideal way to utilize other formats (PDF, XLS...) rather than hand code.

Thanks in advance

 

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