Home DevShare Designing BIRT Reports

Dynamic Columns in a Report

Share

by mblock

Forum - 100 postsDevShare - 25 postsPoll VoterLeaderboard - 10 timesBlog - 1 post
Posted 20 Apr 2012 - 01:47 PM

(0)  (0)   (782 views)

By downloading this item, you are agreeing to the Terms of Use for the site.

Code example for creating dynamic columns in a report with no code in the beforeFactory.

Birt Version:-Actuate 11

Thanks go to Jason Weathersby and Kalesh Mahendrakar for the assist. The attached example dynamically adds columns to a report based on parameters. It could also come from a database for example user preferences. The interesting things (at least for me) were:

  1. I could change the database query on the fly and BIRT would create the dataset bindings for me automatically.
  2. I could add content on the table onPrepare method (usually I did this in the before Factorymethod).

The design uses Classic Models.

Download (2.87 KB)

By downloading this item, you are agreeing to the Terms of Use for the site.



Forum - 100 postsLeaderboard - 1 time

actuser9

Posted: 24 Aug 2012 - 01:53 PM

Very helpful article. Any idea if it is possible to add columns as part of the existing table design after a specific column instead adding to the end of the table?

Forum - 100 postsDevShare - 25 postsPoll VoterLeaderboard - 10 times

mblock

Posted: 27 Aug 2012 - 03:00 PM

The insertColumn has two parameters. The first is the column location and the second parameter is before(-1) or after(1). For example: mytable.insertColumn(2,-1)

Forum - 100 postsLeaderboard - 1 time

actuser9

Posted: 28 Aug 2012 - 04:07 AM

Thank you.
 
Filter More