Reputation: 497
I am trying to generate a BIRT report based on the following (simplified) SQL tables:
Product (ProductCode, ProductDescription, RRP)
- this table has products which are sold and the attributes of the product.StockOnHand (ProductCode, WarehouseName, QtyOnHand)
- this table indicates how much of each product is on hand, in each warehouse.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
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