I have a request that should extract data from three tables A, B, C based on two conditions, these tables A,B and C are located in the same data source.

does BIRT 3.1 supports joint data sets with more than two tables?

Otherwise, is there a way to overcome this limitation?

有帮助吗?

解决方案 3

The solution for this problem is using the stored procedure query, you set your proceure with whatever sql request you want, compile it with your DBMS, and you call it from BIRT with the syntax
call nameOfYourProceure{(?,?,?...)}
Question marks refer to the parameters that you will pass to your stored procedure.

其他提示

You don't say what your data source is, but assuming that it is a SQL data base. You can do something like this in the SQl. You only need to do BIRT joins if the data is in different data sources.

select TableA.Field
, TableB.OtherField
, TableC.SomeOtherField


 from dbo.TableA

  left join dbo.TableB 
       on TableA.Same = TableB.Same

  left join dbo.TableC 
       on TableA.Same = TableC.Same

   where TableA.Important = 'Something'

In addition to James' answer:

In many cases just joining the tables using SQL is the best solution (you should know SQL if you are developing with BIRT, unless someone else prepared the Data Sets and corresponding report items for you).

As an alternative, keep in mind that BIRT does not have a "data model" like other report designers (e.g. Oracle Reports) and that you link data from different data sets by creating a corresponding layout structure, with data set parameter bindings.

You didn't mention the logical structure of your data.

If it's master-detail-detail (for example, artist-album-title), then you would use for example a list item bound to DS "artist", containing a list or table item bound to DS "album" which in turn contains a table bound to DS "title".

The DS "album" would need a DS parameter like "artist_id" or whatever (which you use in the WHERE clause of the SELECT statement), and in the list/table item bound to DS "album", you would use row["artist_id"] as the value for the DS parameter "artist_id".

This is similar for the table item bound to DS "title". However, if the primary key consists of (artist_id, album_id, title_no), you probably need access to the current artist from the outer-most list item. To access this, you use row._outer["artist_id"].

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top