wood burning stoves 2.0*
The moose likes Java in General and the fly likes Match content of a report where column names dynamic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Match content of a report where column names dynamic" Watch "Match content of a report where column names dynamic" New topic
Author

Match content of a report where column names dynamic

Harshana Dias
Ranch Hand

Joined: Jun 11, 2007
Posts: 327

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Match content of a report where column names dynamic
 
Similar Threads
Two questions before submitting.
JPA Multiple Foreign Key Join
about lists
Assignment
Extracting strings from files?