Jump to content
We've recently updated our Privacy Statement, available here ×

Iterating Data with custom DataSource


2004 IR Help

Recommended Posts

By: flux - fluxz

Iterating Data with custom DataSource

2004-03-25 07:18

Hi

I've made some (basic) reports using iReports. Now i need to iterate data in the detail section of my report ( this means i' m looping data in a loop(detail) . Like This :

______

Data1 |

_____ |

Data2 |

Data2 |

Data2 |

-------

Data1 |

_____ |

Data2 |

Data2 |

-------

Now at this point i am able to fill Data1 one with this code (using Custom JRDataSource ) :

 

if("Data1".equals(fieldname))

value = customerDTO.getName() ;

 

I've tried to make a subreport where i've put Data2 in the Detail section. (This Data2 uses its own Custom JRDataSource. )

I can call the subreport using the tab "SubReport(other)" and locate my subreport with a String.

(I see my static text but i don't see my variables ).

But asigning my Custom DataSource doesnt work.

this is what i've got in my .xml

 

<parameter name="MyDataSource" isForPrompting="true" class="datasource.SubReportDataSource"/>

<parameter name="SubReportParam" isForPrompting="true" class="java.lang.String">

<defaultValueExpression ><![CDATA["C:\Backup\workspace\PoleConseil\WebContent\reports\SubReport.jasper"]]></defaultValueExpression>

</parameter>

 

Does anyone know how to solve this problem? Do i need to work with subreport or do i need to work with groups? ( if so would you mind sharing some code snippets? )

 

help appriciated.

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