Sunday, November 9, 2008

BIRT automatic odd even rows highlighting using pre-defined style

specifying highlight rule for table-detail-cell

specifying highlight rule for table-detail-cell

Highlighting odd-even rows in BIRT table can be done easily by adding modulus rule (row.__rownum %2 Equal to 0) to our highlights property on table detail row. Select your table detail row, navigate to highlight property and then add the rule with respective formatting that that you want, and all is done.

But what if you want use standardized odd-even rows hihglighting accross your all of your table reports? The easiest way is to utilize the predefined table style which are table-header, table-detail and table-detail-cell. Those style will be automatically referred by all table in your report, meaning you only need to this once.

Modified version of the top selling product sample report

Modified version of the top selling products sample report

Below is a sample file in doc format (wordpress doesnt allow .rptdesign file) based on the TopSellingProducts.rptdesign example (you can find the unmodified version here). I modified the table there to use incorporate styles whith highlighting rule in it. Open the content in open office or microsoft word editor, copy the content to a new xml file, save the xml file to TopSellingProducts.rptdesign and then open the file in eclipse editor. Good luck!

topsellingproducts

No comments: