visert Posted October 28, 2011 Share Posted October 28, 2011 Himain report "MR"... and its sub report "SR".Data into XML are in 1:n relationship cardinality between MR -> SR records (mr01 -> sr01, mr01->sr02... ecc ecc).Data source is a JRXMLdatasource ( a XML file).Without sorting, the report is printed correctly, But I need to sort both MR and SR records.I pass the datasource from MR to SR with tipical sentence:"((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("field")If I try to sort a field into MR: the JRXMLDataSource "became" ListOfArrayDataSource and so I need to change the sentence into((net.sf.jasperreports.engine.data.ListOfArrayDataSource)$P{REPORT_DATA_SOURCE}) otherwise I ("correctly") receive a cast exception ClassCastException ListOfArrayDataSource cannot be cast JRXmlDataSource.Well... no compile error, no runtime error, but SR is empty. I think because to sort MR the engine has "finished" records?It's possibile inside SR command the restart of scanning of record? If yes... will be correctly assigned to MR records?Thank you to all for help.byebest regards to all! 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