Jump to content
Changes to the Jaspersoft community edition download ×

mahoushi

Members
  • Posts

    4
  • Joined

  • Last visited

mahoushi'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. In the end I created an arraylist with just one element, the bean I wanted as a datasource for my subreport, like this: ArrayList<Object> data = new ArrayList<Object>(); data.add(myBean); JRBeanCollectionDataSource DS = new JRBeanCollectionDataSource(data); parameters.put("formData", DS); Then I added a parameter to my master report called "formData" of the exact same type as a datasource parameter. The problem I was having was because I was trying to do code above in a separate method, and for some wierd reason it didn't work. So I just left all in the same method that create the other parameters, and it did the trick.
  2. I am using a java bean describing the fields I need to show in the subreport. Then I created a JRBeanDataSourceCollection with this bean (called dataSource), and then added the datasource to the report as a parameter, as in the following code: JRBeanCollectionDataSource jrDataSource = new JRBeanCollectionDataSource(dataSource); String pathToRel = request.getSession().getServletContext().getRealPath(pathToReport+jasperFileName+".jasper"); parameters.put("mydatasource", jrDataSource); Those fields in the java bean are the ones I need to read in the subreport, and therefore why I am trying to add the mydatasource parameter as a datasource to the subreport. But still, all I get are null fields... any ideas?
  3. I set the REPORT_PARAMETERS_MAP in the subreport parameters section. With this I can access all parameters from the master report in the subreport, no problems in there. Now what I need to do, is to get the same datasource from the master report in the subreport. I tried setting the subreport datasource expressions as $P{REPORt_DATA_SOURCE}, but still couldn't read the field I wanted, so I tried setting the datasource in my java code, as a parameter, then I set the datasource expression as $P{mydatasource}, but still the field value in my subreport returns null. Any ideas?
  4. Hello all, I am trying to build a report from my java application that uses subreport. I built the fields in my subreport with the same names as the ones in my java bean, but when I pass the master datasource to the subreport ($P{REPORT_DATA_SOURCE} in the datasource expression) the subreport fields are shown null to me. But I can see the field value if I set it in the master report. Maybe I am missing something along the way or setting the datasource in a wrong way? Any help is appreciated :) Using iReport 3.0.0 but tried 3.7.0 and results were the same. Post Edited by mahoushi at 05/18/2010 12:39
×
×
  • Create New...