# Generating a report from window components

**URL:** <https://forum.inductiveautomation.com/t/generating-a-report-from-window-components/20332>\
**Category:** Ignition\
**Created:** [October 23, 2018, 8:58pm UTC](https://forum.inductiveautomation.com/t/generating-a-report-from-window-components/20332 "2018-10-23T20:58:22Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [October 23, 2018, 9:51pm UTC](https://forum.inductiveautomation.com/t/generating-a-report-from-window-components/20332/6 "2018-10-23T21:51:31Z")

</div>

1. Create a new parameter in the report with type Dataset:  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a997c1bb5b47f04f8c811a0ab93ff068a4e50fe6.png)

2. Create a script data source in the report and manipulate the datasource however you want. Here I’m just passing the parameter through:  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/ed226bc102153b1bb67b6e02693b0dacc934ddfe.png)

3. Do something in the report with the new data source:  

4. Add script to button:

```auto
params = {"DatasetParameter": event.source.parent.getComponent('Power Table').data}
settings = {"path":"C:\\Ignition Reports", "fileName":"Report.pdf", "format":"pdf"}
system.report.executeAndDistribute("myReport", "myProject", parameters=params, action="save", actionSettings=settings)

```

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5f0501015c197371ceb81cee378833c4fd5f9ed3.png)

---

_[View the full topic](https://forum.inductiveautomation.com/t/generating-a-report-from-window-components/20332)._
