# Scripting the Save As Excel method of the Report Viewer Component

**URL:** <https://forum.inductiveautomation.com/t/scripting-the-save-as-excel-method-of-the-report-viewer-component/17809>\
**Category:** Ignition\
**Created:** [April 23, 2018, 7:34pm UTC](https://forum.inductiveautomation.com/t/scripting-the-save-as-excel-method-of-the-report-viewer-component/17809 "2018-04-23T19:34:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikeAllgood](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@MikeAllgood](https://forum.inductiveautomation.com/u/MikeAllgood)\
**Post date:** [April 23, 2018, 7:34pm UTC](https://forum.inductiveautomation.com/t/scripting-the-save-as-excel-method-of-the-report-viewer-component/17809/1 "2018-04-23T19:34:25Z")

</div>

I see there is a right click menu option to “Save as XLS”, but I can’t find a way to access this functionality via a script the way the “Save as PDF” can be done using the “saveAsPDF” method. Is this not a built in function of the Report Viewer? Is there a way to glean what the right click menu option does in order to reproduce it?

Thanks,  
Mike

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [April 23, 2018, 7:47pm UTC](https://forum.inductiveautomation.com/t/scripting-the-save-as-excel-method-of-the-report-viewer-component/17809/2 "2018-04-23T19:47:08Z")

</div>

Execute and distribute is what you want.

[https://docs.inductiveautomation.com/display/DOC79/system.report.executeAndDistribute](https://docs.inductiveautomation.com/display/DOC79/system.report.executeAndDistribute)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 23, 2018, 8:38pm UTC](https://forum.inductiveautomation.com/t/scripting-the-save-as-excel-method-of-the-report-viewer-component/17809/3 "2018-04-23T20:38:50Z")

</div>

Or even, creatively, `componentReference.saveAsXls(filename)` - since that’s all that the popup menu is doing anyways.

---

<div class="post-metadata">

**Author:** ![MikeAllgood](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@MikeAllgood](https://forum.inductiveautomation.com/u/MikeAllgood)\
**Post date:** [May 8, 2018, 3:07pm UTC](https://forum.inductiveautomation.com/t/scripting-the-save-as-excel-method-of-the-report-viewer-component/17809/4 "2018-05-08T15:07:39Z")

</div>

Thanks for the helpful input! 😃
