Product: PowerShell Universal
Version: 1.5.15
Hi.
We are using the server-side table processing and wants to make use of the new OnExport feature. But I can’t get it to work.
Only csv export creates files and the files only consists of the csv-separators. Problem can be recreated with the below mentioned dashboard.
I can’t find any errors in logs.
What am I doing wrong? Thank you
New-UDDashboard -Title "Hello, World!" -Content {
New-UDTable -Id 'Export' -LoadData {
$TableData = ConvertFrom-Json $Body
$Data = @(
@{Dessert = 'Frozen yoghurt'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0 }
@{Dessert = 'Ice cream sandwich'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0 }
@{Dessert = 'Eclair'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0 }
@{Dessert = 'Cupcake'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0 }
@{Dessert = 'Gingerbread'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0 }
)
$Data | Out-UDTableData -Page $TableData.page -TotalCount $Data.Count -Properties $TableData.properties
} -Columns @(
New-UDTableColumn -Property Dessert -Title "A Dessert" -IncludeInExport
New-UDTableColumn -Property Calories -Title Calories -IncludeInExport
New-UDTableColumn -Property Fat -Title Fat -IncludeInExport
New-UDTableColumn -Property Carbs -Title Carbs -IncludeInExport
New-UDTableColumn -Property Protein -Title Protein -IncludeInExport
) -ShowPagination -ShowExport -OnExport {
@(
@{Dessert = 'Frozen yoghurt'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0 }
@{Dessert = 'Ice cream sandwich'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0 }
@{Dessert = 'Eclair'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0 }
@{Dessert = 'Cupcake'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0 }
@{Dessert = 'Gingerbread'; Calories = 159; Fat = 6.0; Carbs = 24; Protein = 4.0 }
)
}
}
Content of csv file:
dessert,calories,fat,carbs,protein
,,,,
,,,,
,,,,
,,,,
,,,,