Configuring Excel Print Headers and Footers

This feature is only available for Ambience v4.6.3 & above.


Configuring Excel Print Headers from etc\application.conf

  1. In the etc\application.conf file of your Ambience installation, add in the following lines:
elixir.rml.xlsx.print-header = "Sample Print Header"
elixir.rml.xlsx.print-footer = "Sample Print Footer"
  1. Restart the Ambience Server.

  2. Render the RML template in XLSX format.
    A sample RML template can be downloaded at the end of this entry

  3. From the XLSX output, open it in “Print Preview”

  4. Output should be as follows:
    image
    ^ Top of XLSX output
    image
    ^ Bottom of XLSX output


Configuring Excel Print Headers using OnRenderBegin script of the RML template

  1. In the sample RML template, open the Report Template properties & click on the “Scripts” tab.
    Click on “Report” tab, right-click on Report name and click “Properties”

  2. Add the following lines in “On Render Begin”:

var rd=this.getRenderDetails("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
rd.setParameterValue("PrintHeader","DemoH#DemoHCenter#");
rd.setParameterValue("PrintFooter","Left#Centre#Right");
  1. Save the RML template & render as XLSX output.

  2. From the XLSX output, open it in “Print Preview”.

  3. Output should be as follows:
    image
    ^ Top of XLSX output
    image
    ^ Bottom of XLSX output


Sample RML template:
sample-report.zip (1.6 KB)