• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Match content of a report where column names dynamic

 
Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have a dynamic report to generate where column names are fetch from database table which displays the rooms booked by a employee on a given period. Its like below,


Name Dept Room1(2) Room2(2) Room3(3) Total

A D1 1 1 2
B D2 2 1 3
B D3 1 1 1 3



Rooms can be dynamic where it can have Room4 or Room5 if there is any booking for the identified period.

I made a RoomHeaderDTO list which has the names ordered by the capacity of the room (in brackets of the room name it display the capacity). Name and Dept column i made hard coded and i populate the room names by iterating the list.

Now my problem is how to place the values on number of booking in relevant room. i have another list of DTO which names ContentDTO which have each rows values populate with. For example,



So another instance of DTO contains values A, D1, Room2(2), 1 like wise.

So above is how the DTO looks like for first row. (I have commented the values it will initialized)

Since the column name is dynamic, How should i identify the relavant room name and put the num of booking value when i iterate the ContentDTO (rows) list
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic