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

giscardf

Members
  • Posts

    3
  • Joined

  • Last visited

giscardf's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Just one more thing, it is some kind of odd... but I just change a line of the source code and I am getting a different result. I mean, after moving the DataSource creation, I am not getting the exception anymore. However my subreport is not being printed. I mean, this is probably something wrong I am doing....:-) Regards Code:Vector<ScenarioReport> scenes = new Vector<ScenarioReport>();//JRBeanCollectionDataSource sceneDs = new JRBeanCollectionDataSource(scenes);-- MOVED BELOWEnumeration<ReportNode> scenesNode = caseNode.children();while(scenesNode.hasMoreElements()){ ReportNode sceneNode = scenesNode.nextElement(); scenes.add((ScenarioReport)sceneNode.getData());}//end whileJRBeanCollectionDataSource sceneDs = new JRBeanCollectionDataSource(scenes);HashMap params = new HashMap();params.put("CASE_NAME", SMContainer.getReportThread().getTestCase().getKey());params.put("COMPANY_NAME", GlobalParams.COMPANY);params.put("SCENARIO_REPORT_DATASOURCE", sceneDs); //parameter/fields passed to subreportJasperPrint printReport = JasperFillManager.fillReport(GlobalParams.CASE_REPORT, params, new JREmptyDataSource());JasperViewer.viewReport(printReport);
  2. Hi Morgan, Sorry, But I didn't understand what you mean by "create your new JRBeanCollectionDataSource(scenes) from the report". Just to be more clear, below I am putting a more detailed information: + I do have a report named case_report that contains a subreport named scenario_report + I did define a parameter on my case report, this parameter is named SCNARIO_REPORT_DATASOURCE, in fact this is the parameter whom will contain the JRDataSource to be used by the subreport (named scenario_report) + I did define a parameter on my scenario report, this parameter is also named SCENARIO_REPORT_DATASOURE, this parameter is used also to define the "data source expression" of my subreport. I mean, I created a ConnectionType=Data Source Expression, and the expression is P{SCENARIO_REPORT_DATASOURCE} + Looking at the source code, we can see that I create a JRBeanCollectionDataSource (containing a collection of scenarios), and this collection is inserted into the parameter SENARIO_REPORT_DATASOURE, this parameter is passed to the case report. During report generation the case report send this attribute to the scenario subreport, whom should use the values to fill the subreport (at leas that is how I think things should work...:-) Thanks and Regards Code:
  3. Hi guys, I am creating a very simple report. My application do not use Database, so that is why I am using bean data source. Basically I have a "test case" that contains several "test scenarios". So I create the case report and pass the scenario as a subreport. However when generating the report I am getting the following exeption: 44298 [AWT-EventQueue-0] ERROR fill.JRFillSubreport - Fill 26037402: exception java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) at java.util.AbstractList$Itr.next(AbstractList.java:343) at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.next(JRBeanCollectionDataSource.java:91) at net.sf.jasperreports.engine.fill.JRFillDataset.advanceDataSource(JRFillDataset.java:865) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:783) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1425) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:112) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:911) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:833) at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:565) at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:63) at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:209) at java.lang.Thread.run(Thread.java:619) Looking at the source code I couls see the JRBeanCollectionDataSource tries to change the iterator, i.e, the collection iteself passed to the bean data source. However at this same time, the datasource is iterating over the collection. Probably that is waht is causing the ConcurrentModificationException. I don't know, if this is a bug or a fault of mine, so I would like to share with your guys before report the bug. So, what is your opinion? Thanks and Regards Code:Vector<ScenarioReport> scenes = new Vector<ScenarioReport>();JRBeanCollectionDataSource sceneDs = new JRBeanCollectionDataSource(scenes);Enumeration<ReportNode> scenesNode = caseNode.children();while(scenesNode.hasMoreElements()){ ReportNode sceneNode = scenesNode.nextElement(); scenes.add((ScenarioReport)sceneNode.getData());}//end whileHashMap params = new HashMap();params.put("CASE_NAME", SMContainer.getReportThread().getTestCase().getKey());params.put("COMPANY_NAME", GlobalParams.COMPANY);params.put("SCENARIO_REPORT_DATASOURCE", sceneDs); //parameter/fields passed to subreportJasperPrint printReport = JasperFillManager.fillReport(GlobalParams.CASE_REPORT, params, new JREmptyDataSource());JasperViewer.viewReport(printReport);
×
×
  • Create New...