@@ 2049,21 2049,30 @@ class Compile:
self.data = getattr(self, self.report.parent.key)(
**self.output.report.compilate.args
)
+ if include_data:
+ self.data["df"] = DataStructure(
+ SheetStructure("df", "A1"),
+ self.output.df,
+ self.output,
+ None,
+ )
except AttributeError:
- if include_data or not self.report.pivot:
- self.data = {
- "df": DataStructure(
- SheetStructure("Sheet1", "A1"),
- self.output.df,
- self.output,
- None,
- )
- }
-
if self.report.pivot:
self.data = {}
getattr(self, "adhoc_pivot")()
+ if include_data or not self.report.pivot:
+ structure = DataStructure(
+ SheetStructure("df", "A1"),
+ self.output.df,
+ self.output,
+ None,
+ )
+ try:
+ self.data["df"] = structure
+ except NameError:
+ self.data = {"df": structure}
+
def _metadata(self) -> dict[str, Union[str, dict[str, Any]]]:
"""Prepares the metadata of the class to easily insert into the spreadsheet output."""
metadata = {