Set query FROM table using report parameter in BIRT

Posted by Adam on Stack Overflow See other posts from Stack Overflow or by Adam
Published on 2010-04-04T01:16:45Z Indexed on 2010/04/04 1:23 UTC
Read the original article Hit count: 389

Hi, I am using the BIRT report writer, and I have multiple tables with the same data structure. In my report design, I want to select the table my query uses as a report parameter (as part of a mysql query in the data set) -- but I can't figure it out.

When I create the data set, it's great that I can use parameters in the form of SELECT * FROM WHERE ?, and set these to report parameters, but I get an error if I set the ? to the table, such as:

SELECT * FROM ? WHERE 1

Is there another way I can do this? As it's java, I assume the syntax follows that of a PreparedStatement. In BIRT 2.5 there is a property binding option under the data set dialog... and I've tried setting my query as: "SELECT * FROM "+params["DataTable"].value+" WHERE 1", but that was also results in an error.

© Stack Overflow or respective owner

Related posts about birt

Related posts about prepared-statement