Jump to content

Multiple tables one after the other??


2006 IR Open Dicussion

Recommended Posts

By: Cristina - cristina79

Multiple tables one after the other??

2006-05-31 00:59

Hi all.

 

I'm very frustrated. I need to build a report with ireport and I don't know how to do it.

 

I want to display 10 tables one with each header, and one after the other, like the example below:

 

Table 1

--------

rec 11

 

Table 2

--------

rec 12

rec 22

 

...

 

I'm getting the data through a datasource. I cannot put everything in the detail band beacuse that band is repeated for each record, and then what I get is a mess.

 

I don't want to use a subreport for each table beacuse first, could not be working beacuse I have to display as well the table header and moreover cos now I have to display around 10 tables and this number could increase up to 40!.

 

Anyone has a brilliant idea about how to implement it??. I don't have about groups, frames, crosstabs, but any help will be appreciated!

 

I cannot find any solution and I have to finish it quite soon. I'm lost :-(

 

 

 

 

 

By: Martyn - martyn-hi-ss-nl

RE: Multiple tables one after the other??

2006-05-31 09:59

Just use the groups option. You will need to ensure that the datasource supplies ordered information (Grouped by a value that changes with each table). Make sure you set the group expression to that value that changes with each table. Just look at the subreport example.

 

This will alow you to group into 'tables' (actually a group) and let you to design each table in the group band + detail band.

 

 

 

 

By: Cristina - cristina79

RE: Multiple tables one after the other??

2006-05-31 14:06

Many thanks for the reply.

 

I understand the idea, but how to print the header for each table?.

 

With that approach I will see something like this or am I wrong??

 

Table 1

--------

 

Table 2

--------

record of table 2

record of table 2

 

record of table 1

record of table 1

 

each table has different number of records, and different column names.

 

How should it be the sequence of information that the datasource should provide?.

 

I'm implementing the JRDataSource interface and the next() method will return true until I process all the records in all tables, but as they come from different tables I don't know hot should be the order of the groups/fields to achieve this.

 

In the group example, the final result depicted is like the one I showed on top.

 

Could you please help me a little bit more?.

 

 

 

 

 

By: Cristina - cristina79

RE: Multiple tables one after the other??

2006-05-31 17:30

And I have forgotten to say I have also to insert static text and charts between some of the tables.

 

TABLE 1

--------

record(s) of table 1

 

STATIC TEXT

 

Chart1 Chart2

 

TABLE 2

--------

record(s) of table 2.

 

PD: Anyone knows what's the use of the frames and the sub-datasets?

 

Thanks in advance!!

 

Anyone can help me with a workaround or an idea on how to achieve it?.

 

Otherwise I will have to switch back to XSL:FO and that's too ugly after discovering iReport!!

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...