# Export Perspective report to Excel

**URL:** <https://forum.inductiveautomation.com/t/export-perspective-report-to-excel/42960>\
**Category:** Ignition\
**Created:** [January 27, 2021, 2:44pm UTC](https://forum.inductiveautomation.com/t/export-perspective-report-to-excel/42960 "2021-01-27T14:44:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![atul1.m](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@atul1.m](https://forum.inductiveautomation.com/u/atul1.m)\
**Post date:** [January 27, 2021, 2:44pm UTC](https://forum.inductiveautomation.com/t/export-perspective-report-to-excel/42960/1 "2021-01-27T14:44:41Z")

</div>

Hi PGriffith,

How we can have Report Viewer Table(Only) data exported to XLS or downloaded in form of XLS in perspective likewise we do in Vision.

---

<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:** [January 27, 2021, 5:51pm UTC](https://forum.inductiveautomation.com/t/export-perspective-report-to-excel/42960/2 "2021-01-27T17:51:19Z")

</div>

You can’t, via the report viewer component. Instead, use [`system.report.executeReport`](https://docs.inductiveautomation.com/display/DOC81/system.report.executeReport) to generate the report in Excel format, then `system.perspective.download` to initiate a download with the user.

---

<div class="post-metadata">

**Author:** ![atul1.m](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@atul1.m](https://forum.inductiveautomation.com/u/atul1.m)\
**Post date:** [January 28, 2021, 8:04am UTC](https://forum.inductiveautomation.com/t/export-perspective-report-to-excel/42960/3 "2021-01-28T08:04:48Z")

</div>

I doubt if Parameter can take a Datasource values in my case its a StaticCSV Values

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/4/e4f1fb19ad717c96be433e7cbb134ea92dac3284.png) .

---

<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:** [January 28, 2021, 5:02pm UTC](https://forum.inductiveautomation.com/t/export-perspective-report-to-excel/42960/4 "2021-01-28T17:02:00Z")

</div>

You absolutely can pass a dataset as a parameter, you just need to pass it as a dictionary; eg:  
`bytesArray = system.report.executeReport(path="My_Report_Folder/Shift_Report", project="Reports", parameters = {"data": DT_Data}, filetype="xls)`

And that would pass directly to `system.perspective.download`:  
`system.perspective.download("Shift Report", bytesArray)`

---

<div class="post-metadata">

**Author:** ![atul1.m](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@atul1.m](https://forum.inductiveautomation.com/u/atul1.m)\
**Post date:** [February 3, 2021, 3:19am UTC](https://forum.inductiveautomation.com/t/export-perspective-report-to-excel/42960/5 "2021-02-03T03:19:36Z")

</div>

Now i am getting this error of DT\_Data is not defined Global:-

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/3/2347ab7338e4233fc4e24a73d07f069c5eb4a2e0.png)

---

<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:** [February 3, 2021, 4:08pm UTC](https://forum.inductiveautomation.com/t/export-perspective-report-to-excel/42960/6 "2021-02-03T16:08:42Z")

</div>

You used `DT_Data` in your earlier example that you took a screenshot of. I don’t know where you defined that variable, if at all. You won’t have access to it if it’s some dataset from a Perspective session, but you can always pass a manually constructed dataset for testing. Or, you can do your script testing within the Perspective console.

---

<div class="post-metadata">

**Author:** ![atul1.m](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@atul1.m](https://forum.inductiveautomation.com/u/atul1.m)\
**Post date:** [February 4, 2021, 1:57pm UTC](https://forum.inductiveautomation.com/t/export-perspective-report-to-excel/42960/7 "2021-02-04T13:57:37Z")

</div>

Thanks PGriffith for the reply.

I have manually Created the Data inside Report in Data Source as “Static CSV DT-Data” .I want to convert same Report Static CSV DT-Data Datasource into Excel while fetching it from Perspective View.

---

<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:** [February 4, 2021, 3:48pm UTC](https://forum.inductiveautomation.com/t/export-perspective-report-to-excel/42960/8 "2021-02-04T15:48:19Z")

</div>

If it’s a static CSV data key, then you don’t need to provide _anything_ in the parameters dictionary - it’s only for providing (as the name implies) _parameters_ to your report. Just make it an empty dictionary: `{}`.

---

<div class="post-metadata">

**Author:** ![dhiraj.pawar](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@dhiraj.pawar](https://forum.inductiveautomation.com/u/dhiraj.pawar)\
**Post date:** [November 6, 2023, 7:46am UTC](https://forum.inductiveautomation.com/t/export-perspective-report-to-excel/42960/9 "2023-11-06T07:46:40Z")

</div>

Hello Griffith,  
I have tried the same method. Now im able to export the report but report format getting distorted & will created different spreadsheet. can you suggest us what i did wrong?

We have tried system.report.execute&Distribute() function & Report Schedule feature to save on gateway but found same behaviour distorted -report with multiple spreadsheet

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/7/27855d66dcb0991c1ca69a7cce7876606a8212f0.jpeg)

 ![Script](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/5/758c4ee65dfdd9adb8dc420af6c6b192730ec616.png)

 ![Distorted report](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/b/7bcddd802a959ec54b83f6c3b2e78ad1edf8c5cb.png)

---

<div class="post-metadata">

**Author:** ![Batuhan\_Parlakay](https://avatars.discourse-cdn.com/v4/letter/b/e47c2d/32.png) [@Batuhan\_Parlakay](https://forum.inductiveautomation.com/u/Batuhan_Parlakay)\
**Post date:** [February 20, 2025, 6:15pm UTC](https://forum.inductiveautomation.com/t/export-perspective-report-to-excel/42960/10 "2025-02-20T18:15:17Z")

</div>

> [@dhiraj.pawar](#):
>
> ello Griffith,  
> I have tried the same method. Now im able to export the report but report format getting distorted & will created different spreadsheet. can you suggest us what i did wrong?
> 
> We have tried system.report.execute&Distribute() function & Report Schedule feature to save on gateway but found same behaviour distorted -report with multiple spreadsheet

Hi,  
Were you able to find a solution to this report format problem?
