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

Loading Subreport Based on a Fields Value


prinsesajade

Recommended Posts

hi!does anyone have any idea on how i can do this or is this possible?

here's the scenario..

i have my main report which is a list of teams..for every team will be a subreport of the production of each team..so say for example in page 1 i have team A as the heading and its subreport, in page 2 will be team B and its subreport and so on..

in my subreport i have these fields for regular work hours and  night differential..a product can be created on a regular working hour or on night..so if it is created in regular work hour (10am-6pm)  the field for night differential should not be displayed..the column should be hidden..

now here's the problem..say for example in page 1, that is TEAM A, all products in that team was created in regular work hours so the night field should be hidden..

in page2, TEAM B, there are some products that are created at night so night field is not hidden..

any idea how can i do this?thank you..

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

i found the answer to my problem..

what i did is i created 2 subreports.the first one was the subreport with the complete fields and the second report is the one without the night field(that was the field i need to hide)..then in my java class i created a condition and put the result in a map according to the team id..say for example TEAM A's products are all created in regular hours a set a boolean to true and otherwise false..then put it to map

map.put(teamId, booelanValue)

and put this map to my report parameters map..

params.put("MAP", map)

in subreport properties --> Subreport Expression i wrote a condition that if my parameter MAP returns true load subreport 2(night fields are hidden) otherwise load subreport 1(all fields are shown)..

 

 

 

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...