Pivot Table & Charts Component Documentation


save(filename:String, destination:String, callbackHandler:String, url:String, embedData:Boolean):String

Version: 1.4

You can use this method to save your current report to a specified location. Later if open it you will see this saved previously report as it was seen while saving it with all fields, applied filters and sortings same like you placed it.

Returns XML configuration of a report as a String.


  • filename – a default name of the file.
  • destination (optional) – parameter defines how to save a generated file. File can be saved to "server", "file" or "clipboard". The default value is "file".
  • callbackHandler (optional) – JS function which will be called when the report is saved.
  • url (optional) – an URL to the server-side script which saves the generated file. The file is sent as a POST parameter. Use this parameter only if destination parameter is "server".
  • embedData (optional) – specifies whether to save CSV/OCSV data within the report or not. Default value is false. (Available since version 2.120)


How to save a report to the local file system:

flexmonster.save('myreport.xml', 'file');

How to save a report to the server:

  'server', '', 'http://yourserver.com/yourscript.php');

Please note that the server-side script should be created on your back-end to be able save reports to the server. And an url parameter is the path to this server-side script.

How to save a report and perform some JS code right after the report was already saved:

<button onclick="javascript: flexmonster.save('myreport.xml', 'file','reportSaved')">Save Report</button>
<script type="text/javascript">
  function reportSaved() {
    // some JS code 

How to save a report to clipboard:

flexmonster.save('myreport.xml', 'clipboard');

See also


Suggest Edit