Birt uses scripts to change Background coloring

Source: Internet
Author: User

Eclipse Birt changes the background color of data rows
For the data area in the report, how can we implement the following to achieve a different color for every row:
1. Hover your mouse over the table and select row detail;
2. Select the script tab to open the Birt script editing window;
3. Select onprepare from the drop-down list and add the following Javascript script:
VaR COUNT = 0;
4. Select oncreate from the drop-down list and add the following Javascript script:
Count ++;
If (count % 2 = 0 ){
This. getstyle (). backgroundcolor = "# efefef ";
} Else {
This. getstyle (). backgroundcolor = "# d4d0c8 ";
}
5. Save and use web reviewer for preview. The data can be displayed by page. Do not use the preview tab for browsing. The browsing effect of this tab is not paging. Publish to the web project. You can also display it by page.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.