DEV Community

Maik Michel
Maik Michel

Posted on • Originally published at micodify.de on

Addionaly Group Column Heading in Classic Report

In my projects it sometimes happens that I have a lot of columns in a classic report. Of course, this has a negative effect on the look and feel. Often it helps here to outsource similarities of the respective columns in an additional heading line. You can find out how to do that right here.

We create a Dynamic Action on the corresponding report that fires on the event AfterRefresh.

As the actual action, we choose to execute JavaScript code, which should also be executed on load.

Following lines of JavaScript, insert a new line before the actual heading line generated by APEX:

apex.jQuery(this.triggeringElement).find('thead').prepend(`
      <tr id="tab-group-heading"> +
        <th class="t-Report-colHead" align="center" colspan="1"></th> +
        <th class="t-Report-colHead" align="center" colspan="5">The Book</th> +
        <th class="t-Report-colHead" align="center" colspan="2">Publish</th> +
      </tr>`
    );
Enter fullscreen mode Exit fullscreen mode

Done. You can find a demo here.

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay