Jump to content
Changes to the Jaspersoft community edition download ×

multiple tables/data source


2005 IR Help

Recommended Posts

By: Aleksey Konovalov - alexsmar

multiple tables/data source

2004-01-29 14:32

Hi!

One of my reports, I'm trying to develop using JasperReports, contains data collected from 4 different database tables. Let assume these tables have the following names: dbt1, dbt2, dbt3, and dbt4. For naming fields from any of those table the following convention would be used: dbt1:field1. For each record from dbt1 corresponding records are pulled out of the database from the tables dbt2, dbt3, dbt4. Report has to display that data in 5 different report tables in the following form for each record from dbt1:

 

dbt1:field1

------------------------------------

dbt1:field2 | dbt1:field3 | dbt1:field4 |

------------------------------------

 

------------------------------------

dbt1:field5 | dbt:field6 | dbt1:field7 |

------------------------------------

 

------------------------------------

dbt2:field1 | dbt2:field2 | dbt2:field3 |

------------------------------------

dbt2:field1 | dbt2:field2 | dbt2:field3 |

------------------------------------

dbt2:field1 | dbt2:field2 | dbt2:field3 |

------------------------------------

...

dbt2:field1 | dbt2:field2 | dbt2:field3 |

------------------------------------

 

------------------------------------

dbt3:field1 | dbt3:field2 | dbt3:field3 |

------------------------------------

dbt3:field1 | dbt3:field2 | dbt3:field3 |

------------------------------------

dbt3:field1 | dbt3:field2 | dbt3:field3 |

------------------------------------

...

dbt3:field1 | dbt3:field2 | dbt3:field3 |

------------------------------------

 

------------------------------------

dbt4:field1 | dbt4:field2 | dbt4:field3 |

------------------------------------

dbt4:field1 | dbt4:field2 | dbt4:field3 |

------------------------------------

dbt4:field1 | dbt4:field2 | dbt4:field3 |

------------------------------------

...

dbt4:field1 | dbt4:field2 | dbt4:field3 |

------------------------------------

 

Such sequence has to be repeated for each record from dbt1 within this report. I was wondering if that could be done using jasperreport. And if that's so, then what facilities would be better to use.

Thanks.

 

 

 

 

By: Axel Hallez - ahallez

RE: multiple tables/data source

2004-02-03 07:16

You can use subreports to do this.

Use a query on dbt1 in the main report. In the subreport you can query dbt2-4.

Use parameters to make the link between the main report and the subreports.

 

Axel Hallez

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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