Jump to content
JasperReports Library 7.0 is now available ×

Is recursion in iReports possible?


2004 IR Help

Recommended Posts

By: Jen - jjkemp

Is recursion in iReports possible?

2004-07-08 06:11

I need to do a BOM report....

Is it possible to do recursion with iReports?

If so, does anyone know how?

 

 

 

 

 

 

By: Jen - jjkemp

RE: Is recursion in iReports possible?

2004-07-08 07:06

Product Stucture... Finished Goods with all the components....

So, how do I do it?

 

 

 

 

 

By: Giulio Toffoli - gt78

RE: Is recursion in iReports possible?

2004-07-08 07:21

 

You must use subreports. Subreport can be recursive.

 

Using a custom datasource able to produce dinamically sub datasources you can fill your subreports recursively.

 

Giulio

 

 

 

 

 

By: Jen - jjkemp

RE: Is recursion in iReports possible?

2004-07-08 07:38

I know I need to use subreports, but I'm not sure how to retrieve the recursive effect....

This is what I'm trying to produce....

Finished Good Part

Component 1

Component 2

Component 3

 

But, each of the components can also have multiple components, and each of those can also have components....

I need to list them all

 

 

 

 

 

By: Giulio Toffoli - gt78

RE: Is recursion in iReports possible?

2004-07-08 06:56

Yes, recursion is possible.

But what is a BOM ?

 

Giulio

 

 

 

 

By: Mark Rhodes - mrhodes2

RE: Is recursion in iReports possible?

2004-07-08 09:14

I think this is a data query problem, not a report problem. I had similar problem used a view with 3 union queries to get the data. Luckily my recursion never went beyond two levels. If you have unlimited levels this would be challenging. I didn't use subreports.

 

 

 

 

By: Rick Millar - rmillar

RE: Is recursion in iReports possible?

2004-07-08 10:44

Is the query for each recursion identical? If so, you may be able to define a subrereport that itself contains a subreport. The nested subreport would refer to the 1st level subreport, for recursion. I believe you have to use a "print when" expression for the subreport so that when you reach a no more components condition, you can end the recursion.

 

 

 

 

By: Jen - jjkemp

RE: Is recursion in iReports possible?

2004-07-08 11:40

Sounds like that would work, but can you tell me the format for the "print when" expressions?

Or point me toward a tutorial or FAQ for this?

I'm new to iReports, so I have no idea what it's suppose to include.

 

 

 

 

 

By: Rick Millar - rmillar

RE: Is recursion in iReports possible?

2004-07-08 12:23

I believe the "print when" expression like all expressions in iReports can be any valid Java expression. However, in the case of a "print when" expression it must return a type of boolean.

 

Here is what I have as a print when expression in one of my reports.

 

new Boolean( $P{SHOW_USERS}.equalsIgnoreCase("y") )

 

It is a simple case where if the value of my parameter SHOW_USERS is equal to the string value "y," then the subreport is called.

 

In your case, I think you may need an expression that returns false when the value (component_id?) you pass to the subreport is null.

 

 

 

 

 

 

By: Jen - jjkemp

RE: Is recursion in iReports possible?

2004-07-15 07:27

It's not working....

My file has the fields component and parent

My main report selects parents where the component = input paremter; it has subreport A with a paremeter of parent

My subreport A selects parents where the component = input parameter (parent from main report); it has subreport B with a paremter of parent

My subreport B selects parents where the component = input paremeter (parent from subreport A); it has subreport A with a paremter of parent; it has a print when condition of parent = null

I'm only getting 2 levels, the input component, it's parent, and the parent's parent; there are at least 4 levels

 

What do I have wrong? Can anyone follow this and offer help?

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