# ExportExcel and pyDataSet

**URL:** <https://forum.inductiveautomation.com/t/exportexcel-and-pydataset/102057>\
**Category:** Ignition\
**Created:** [February 7, 2025, 9:30pm UTC](https://forum.inductiveautomation.com/t/exportexcel-and-pydataset/102057 "2025-02-07T21:30:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vrautomation](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/vrautomation/32/11155_2.png) [@vrautomation](https://forum.inductiveautomation.com/u/vrautomation)\
**Post date:** [February 7, 2025, 9:30pm UTC](https://forum.inductiveautomation.com/t/exportexcel-and-pydataset/102057/1 "2025-02-07T21:30:49Z")

</div>

I just found out that ExportExcel do not work with pyDataset.

At some point, NamedQueries began to output a pyDataSet instead of a dataset. Since that moment, we need to convert the output of a named query to a simple dataset before calling the ExportExcel function.

I let this here in case it could help someone else.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 7, 2025, 9:36pm UTC](https://forum.inductiveautomation.com/t/exportexcel-and-pydataset/102057/2 "2025-02-07T21:36:44Z")

</div>

I was under the impression that this was being refactored in v8.3 to make all Datasets implicitly PyDatasets, and vice versa. So may be moot before too long.

---

<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 7, 2025, 9:46pm UTC](https://forum.inductiveautomation.com/t/exportexcel-and-pydataset/102057/3 "2025-02-07T21:46:25Z")

</div>

> [@vrautomation](#):
>
> I just found out that ExportExcel do not work with pyDataset.

What does "does not work" mean, and what's happening?

Since a _long_ time ago, early in the 8.0 lifecycle, `PyDataSet` was changed to directly implement the `Dataset` Java interface, so any Java code that expects a Dataset can transparently accept a pydataset.

In 8.3, as Phil mentioned, there is no need to explicitly wrap in `PyDataSet` - any time you interact with a dataset via scripting, you'll be able to use all of the pydataset methods _and_ all of the underlying dataset methods, with no need to explicitly wrap or unwrap.

---

<div class="post-metadata">

**Author:** ![vrautomation](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/vrautomation/32/11155_2.png) [@vrautomation](https://forum.inductiveautomation.com/u/vrautomation)\
**Post date:** [February 10, 2025, 7:29pm UTC](https://forum.inductiveautomation.com/t/exportexcel-and-pydataset/102057/4 "2025-02-10T19:29:04Z")

</div>

Here is what I mean...

A named query retreive a dataset. **This dataset can be show correctly in a power table in Vision.**

## The error occur when I call system.dataset.exportExcel. I get this exception:

java.lang.ArrayStoreException: arraycopy: element type mismatch: can not cast one of the elements of java.lang.Object to the type of the destination array, com.inductiveautomation.ignition.common.Dataset

caused by ArrayStoreException: arraycopy: element type mismatch: can not cast one of the elements of java.lang.Object to the type of the destination array, com.inductiveautomation.ignition.common.Dataset

## Ignition v8.1.39 (b2024040909)

This was working good in Ignition 8.1.33.

To solve the issue, I add a line to convert the pyDataset to a simple dataset  
ds = system.dataset.toDataSet(ds)

It's working good with this line.

I hope it clarify.,
