<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<div>
<h2>How to export collapsed data on the grid</h2>
<p>
To include all data in the export, we suggest using the following approach:
</p>
<ol class="styledList">
<li>Copy the current report configuration (line 37 in the JavaScript box). We are going to restore it later.</li>
<li>Subscribe to the <a href="https://www.flexmonster.com/api/aftergriddraw/" target="_blank">aftergriddraw</a> event (lines 38-45).</li>
<li>Expand all data on the grid (line 47). It is needed to temporarily display all collapsed data.</li>
<li>Once we expand the data on the grid, the <code>aftergriddraw</code> event is triggered. In its handler, we export the report and restore the previously saved report configuration (lines 40-44).</li>
</ol>
<p>
<a href="https://www.flexmonster.com/doc/export-and-print/" target="_blank">Visit our documentation to learn more about export in Flexmonster</a>.
</p>
</div>
<button onclick="exportFullGrid()">Export Entire Grid</button>
<div id="pivot-container"></div>