Can we create dynamic column header text in Reports?

Can anyone please clarify the following technical questions regarding reporting.

•Can we create dynamic column header text in Reports? For example if we create a report that displays sales data for the current, previous and next month can we display the name of the month dynamically based on the current month.

•Is it possible to display multiple reports in a single page similar to dashboards? If not a standard feature how do we achieve this by visualforce?


  1. No. Headers are based on field names, and field names cannot be dynamic. You would need to update the field names (and their formulas) to be accurate.

  2. A dashboard is a collection of reports. Displaying detail data would be relatively unwieldy, but if you were determined to do this, you could achieve this in Visualforce. A very basic example follows:


<apex:page controller="reportViewer" readOnly="true">
    <apex:dataTable value="{!reports}" var="report">
        <apex:column value="{!}" headerValue="Report Name"/>
        <apex:column headerValue="Results"><apex:outputText escape="false" value="{!}"/></apex:column>


public with sharing class reportViewer {
    public class ReportItem {
        public string name { get; set; }
        public string data { get; set; }

    Report[] records;

    public reportViewer() {
        records = [select id,name from report limit 5];

    public ReportItem[] getReports() {
        ReportItem[] results = new ReportItem[0];
        for(Record record:records) {
            ReportItem item = new ReportItem();
   = new apexpages.pagereference('/''?excel=1').getContent().toString();
        return results;
  • Note, this code hasn’t been tested beforehand, so it may require small adjustments.

  • For more complex scenarios, you’ll have to parse the output from the report yourself, which may be non-trivial.

Source : Link , Question Author : Arun , Answer Author : sfdcfox

Leave a Comment