I have a report that is generated from an oracle query. Let's say the data comes back like this:
STATE_RNUM | CITY_RNUM | STATE | CITY | POPULATION | MEDIAN_HOUSE_INC | MEAN_HOUSE_INC
1 | 1 | Wisconsin | Milwaukee | 999999 | 99999 | 99999
1 | 2 | Wisconsin | Green Bay | 999999 | 99999 | 99999
1 | 3 | Wisconsin | Rhinelander | 999999 | 99999 | 99999
2 | 1 | Indiana | Indianapolis | 888888 | 88888 | 88888
2 | 2 | Indiana | Gary | 888888 | 88888 | 88888
2 | 3 | Indiana | Bloomington | 888888 | 88888 | 88888
...and so on...
I want to display the data in the report like this:
State: Wisconsin
Milwaukee | 999999 | 99999 | 99999
Green Bay | 999999 | 99999 | 99999
Rhinelander | 999999 | 99999 | 99999
State: Indiana
Indianapolis | 888888 | 88888 | 88888
Gary | 888888 | 88888 | 88888
Bloomington | 888888 | 88888 |88888
If I output the state name whenever the CITY_RNUM = 1, I can get it to do the above layout. However, if the state's city listing spans multiple pages, the state name does not get repeated on the new page. I would like to repeat theState: [state_name] on the 2nd page before displaying more cities for that state.
How do I determine if I'm displaying the first record on a given page? I was hoping there would be a way to do "if the city_rnum = 1 OR if the city being displayed is the first one on the page, display the city name". I have not
yet been able to determine how to do this and any help would be appreciated.
Thanks, Ryan