europe72 Posted August 13, 2010 Share Posted August 13, 2010 I have an invoice report, which contains - in the detail band - an invoice-item subreport used to display the invoice item records for the invoice. Passed to the invoice-item subreport is an integer invoice id, which is the foreign key for the items (typical 1-N scenario). The invoice report and the invoice-item subreport share a report connection (FYI). Within the invoice-item subreport is another subreport - the sales-office subreport. The connection type property of the sales office subreport specifies "Use a datasource expression," and the datasource expression itself specifies a parameter from the invoice-item subreport: "$P{SUBREPORT_DATA_SOURCE}." $P{SUBREPORT_DATA_SOURCE} is defined as follows: new JRCsvDataSource(new File("/opt/reports/sales_offices.csv")) The sales_offices.csv file referenced above contains two columns COLUMN_0 and … 1. COLUMN_0 contains the country name in which the sales office is located, and COLUMN_1 contains the sales-office address. COLUMN_0 is used in the filter expression, while COLUMN_1 is used for display. e.g. Filter expression in sales-office subreport is: new Boolean($P{COUNTRY_NAME}.equals($F{COLUMN_0})) where $P{COUNTRY_NAME} is a parameter (the only parameter) passed to the sales-office report from the invoice-items report. Everything works well. Meaning that the invoice report displays N number of invoice items via the invoice-items subreport, and the sales-office report displays the correct sales office via the sales-office subreport, per the country name passed from invoice items in $P{COUNTRY_NAME}. The trouble is though that the sales office ***only ever displays for the first invoice item***. It does not display for each invoice item as it should. I'm pretty baffled by this and don't really know where to look for a solution. Any help would be much appreciated. Link to comment Share on other sites More sharing options...
europe72 Posted August 15, 2010 Author Share Posted August 15, 2010 On further inspection the sales office subreport itself is only printed for the first invoice item. What would cause the subreport (in this scenario) to only print for one - the first - detail row? Link to comment Share on other sites More sharing options...
europe72 Posted August 18, 2010 Author Share Posted August 18, 2010 *ping* Link to comment Share on other sites More sharing options...
teodord Posted August 19, 2010 Share Posted August 19, 2010 Hi, Instead of pinging, you would better post the files involved, so that we can clearly see where the problem is.Thanks,Teodor Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now