Hey there, I’m having a problem with UDTable where tables don’t paginate, instead they show all rows on a single page.
The tables show the correct count of rows at the bottom of the table.
Additionally, trying to export the table to any format (csv, xml, xls) etc. does not work.
I think it has something to do with server side processing - this affects both version 1.5.8 and 2.6.2 (I tried upgrading to resolve).
The problem affects all of my tables with completely different data sources and approaches (hashtables vs arrays etc).
Pagination and export works fine as soon as I remove any processing and simply use static dummy data. I’ve also tried completely blank/new installs of UD after deleting the database.
Running on IIS.
This has been bugging me for years, can anyone help?
An example of one of my simpler tables is included below - refuses to export or paginate (usually returns around 500 rows which are all displayed on a single page).
Any guidance would be greatly appreciated.
$Pages += New-UDPage -Name "Device Manager" -Content {
New-UdTable -Title 'Device Manager' -showsearch -pagesize 10 -export -columns @(
New-UdTableColumn -Property Name -Title 'Device Name' -IncludeInSearch
New-UdTableColumn -Property Description -Title 'Description' -IncludeInSearch
New-UdTableColumn -Property ID -Title 'Device ID' -IncludeInSearch
New-UdTableColumn -Property DeviceID -Title 'Device MAC' -IncludeInSearch
) -LoadData {
$TableData = ConvertFrom-Json $Body
$user = 'admin'
$pass = 'pass'
$pair = "$($user):$($pass)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"
$Headers = @{
Authorization = $basicAuthValue
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$response = Invoke-WebRequest -Uri 'https://URLToSomeJSONData' -Headers $Headers
$responseformatted = $response.Content | ConvertFrom-Json
$responseformattedobjects = $responseformatted.objects
$data = $(Foreach ($formattedobject in $responseformattedobjects) {
@(
@{
Name = $formattedobject.Name
ID = $formattedobject.Id
DeviceID = $formattedobject | Select-Object -ExpandProperty Address
Description = $formattedobject.Description
}
)
}
)
$data | Out-UDTableData -Page $TableData.page -TotalCount $Data.Count -Properties $TableData.properties
}
}