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

maelan.desPrezdelamorlais_

Members
  • Posts

    1
  • Joined

  • Last visited

maelan.desPrezdelamorlais_'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. Hello reader, I'm a bit new to jasper and was trying to do something, maybe not allowed. I'm trying to print a report containing a List of ReportData, each ReportData containing some values and a collection of Beans printed in a subreport. So what i wanted to do was putting my ReportData values in Detail Band, then (in detail band) a subreport to print my bean collection (and have it's own page number). Here is a json exemple : [ {"FieldA":"Value","FieldB":[{"FieldB1":"Value","FieldB2":"Value","FieldB3":"Value", "FieldB4":[{"FieldB4A":"value","FieldB4B":"value","FieldB4C":"value"},{"FieldB4A":"value","FieldB4B":"value","FieldB4C":"value"},{"FieldB4A":"value","FieldB4B":"value","FieldB4C":"value"}]}, {"FieldA":"Value","FieldB":[{"FieldB1":"Value","FieldB2":"Value","FieldB3":"Value", "FieldB4":[{"FieldB4A":"value","FieldB4B":"value","FieldB4C":"value"},{"FieldB4A":"value","FieldB4B":"value","FieldB4C":"value"},{"FieldB4A":"value","FieldB4B":"value","FieldB4C":"value"}]}, {"FieldA":"Value","FieldB":[{"FieldB1":"Value","FieldB2":"Value","FieldB3":"Value", "FieldB4":[{"FieldB4A":"value","FieldB4B":"value","FieldB4C":"value"},{"FieldB4A":"value","FieldB4B":"value","FieldB4C":"value"},{"FieldB4A":"value","FieldB4B":"value","FieldB4C":"value"}]} ] I tried using "$P{REPORT_DATA_SOURCE}.subDataSource("FieldB4")" with and without cast (net.sf...JSonDataSource) as datasource expression. It did'nt worked. I tried to set my type as collection, list, and so on, to use "new net.sf...JRBeanCollectionDataSource($F{FieldB4})", but i got error saying it failed to read the field and convert it. So, my question is, how should i declare/use my "FieldB" to get a dataSource from it for my subreport, with one occurence of the subReport by occurence of Detail Band? Like That : FieldA : It's Value (the first one) SubReport with first FieldB as dataSource (this subReport has a table wich explain why FieldB4 is a list) Field A : It's Value (the second one) SubReport with second FieldB as dataSource And so on. ===================================================================================================================== Up ? - 21/10/2016
×
×
  • Create New...