Export report/dashboard as an image

As of build 2762 of InFront 3.2 we have added an api endpoint to export a given report or dashboard as an image.

Send a http post request to one of the following urls:

Report: http://<<infront>>/api/report/<<reportid>>/render/<<filetype>>
Dashboard: http://<<infront>>/api/dahboard/<<dashboardid>>/render/<<filetype>>

  • Supported filetypes are png, jpg or pdf
  • The body of the request has the same structure as a normal export to pdf.
  • It also accepts the following optional query parameters
    • width: On export of dashboard the default width is 1200px. If width is omitted on report, the image will be the full width of the report.
    • height:  On export of dashbaord the default height is 800px If height is omitted, the image will be the full height of the report.
    • zoom: a value of 1 is 100% a value of 0.5 is 50%. a size needs to be specified to set the zoom level. Default is 1. Only applies to pdf.
    • showheader: Set to false if you want to hide header. Default is true.
    • showfilters: Set to false if you want to hide filters. Default is true.

Quick tip: To find what to send as the body of the request. Do an “Export to Pdf” on the report you want to export. Then look at the network tab in “Chrome developer tools” for the request. Click on the request. In the at the “headers” tab you will find the “request payload”. That is the payload to be used in the body of the request. Modify as needed.