# Export Report viewer report in Excel Format

**URL:** <https://forum.inductiveautomation.com/t/export-report-viewer-report-in-excel-format/53329>\
**Category:** Ignition\
**Created:** [November 22, 2021, 9:53am UTC](https://forum.inductiveautomation.com/t/export-report-viewer-report-in-excel-format/53329 "2021-11-22T09:53:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [November 22, 2021, 9:53am UTC](https://forum.inductiveautomation.com/t/export-report-viewer-report-in-excel-format/53329/1 "2021-11-22T09:53:24Z")

</div>

Hi @paul-griffith

i am saving the report from report viewer

I have using the script to save data in pdf and excel

```auto
format = event.source.parent.getComponent('Dropdown_Format').selectedStringValue
window = system.gui.getWindow("EMS/EMS_Dynamic_Report")
if format == "PDF":
	window.getComponentForPath("Root Container.Report Viewer").saveAsPDF("Daily Report") 
if format == "Excel":
	window.getComponentForPath("Root Container.Report Viewer").saveAsXls("Daily Report")
system.nav.closeParentWindow(event)

```

But when i save the file in excel format i am getting black rectangle box in excel

 ![error in excel](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/3/f3f27a70c5768d8add61aadbb518e8f937d4aa8b.png)

only i am getting this issue in excel format. PDF format getting data fine

any change need to be done in script?  
can any one help me out

---

<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:** [November 22, 2021, 4:10pm UTC](https://forum.inductiveautomation.com/t/export-report-viewer-report-in-excel-format/53329/2 "2021-11-22T16:10:34Z")

</div>

This is probably not an issue with your script, but an issue with the reporting module’s export format. What version of Ignition are you using?

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [November 22, 2021, 4:23pm UTC](https://forum.inductiveautomation.com/t/export-report-viewer-report-in-excel-format/53329/3 "2021-11-22T16:23:27Z")

</div>

Ignition platform - 8.1.7

Reporting module - 6.1.7

Is there any way to fix it?

---

<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:** [November 22, 2021, 4:28pm UTC](https://forum.inductiveautomation.com/t/export-report-viewer-report-in-excel-format/53329/4 "2021-11-22T16:28:06Z")

</div>

I have no idea, because I don’t know the nature of the problem.

Are you embedding some kind of background image in the report? Where is it coming from?  
In Excel, can you select the black square and delete it; i.e. is it arriving as a separate overlaid component in Excel?

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [November 22, 2021, 4:39pm UTC](https://forum.inductiveautomation.com/t/export-report-viewer-report-in-excel-format/53329/5 "2021-11-22T16:39:26Z")

</div>

Yes its coming separate overlaid. When i delete it i can able to see tha data

This issue is not happening when i right click the report component and choose excel format.  
That time i am not getting any issue

---

<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:** [November 22, 2021, 4:58pm UTC](https://forum.inductiveautomation.com/t/export-report-viewer-report-in-excel-format/53329/6 "2021-11-22T16:58:33Z")

</div>

Oh, good news. Try changing your code to call `saveAsXlsx`, instead of `saveAsXls`. You’re inadvertently using ‘legacy’ exporting code.
