Bob
Bob

Reputation: 497

BIRT - dynamically add columns

I am trying to generate a BIRT report based on the following (simplified) SQL tables:

Now I'd like to generate a report where each row shows each product and its attributes, as well as the stock on hand in various warehouses. But I don't know ahead of time which warehouses to show the stock on hand for, as this will be passed as a report parameter.

So the columns of the report would look something like the following: ProductCode,ProductDescription,RRP,Warehouse1StockOnHand,Warehouse2StockOnHand,...,WarehouseNStockOnHand

I'm not clear on the best way to generate a dynamic set of columns. I've come across one solution which is based on building the report in Java code.

I am wondering if there is a simpler solution which does not involve writing custom Java code?

Upvotes: 1

Views: 643

Answers (1)

hvb
hvb

Reputation: 2669

I think what you need is a BIRT cross tab report. Alternatively - if you don't like BIRT cross tabs - you can create your "cross tab" using SQL pivot or SQL analytic functions and then use a simple table item in BIRT:

Upvotes: 2

Related Questions