Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I am trying to iterate through a hypercube's pages and I am getting this error in VB. NET:
Argument not specified for parameter 'nxPages' of 'Public Shared Overloads Function [Next](nxPages As IEnumerable(Of NxPage)) As IEnumerable(Of NxPage)'.
The code used is ( courtesy of this blog post ):
Dim obj As Qlik.Sense.Client.Visualizations.Table = app.GetObject(Of Qlik.Sense.Client.Visualizations.Table)(objectid)
Dim qsPager = obj.GetHyperCubePager("/qHyperCubeDef")
Dim qsWidth = qsPager.NumberOfColumns
Dim qsHeight = qsPager.NumberOfRows
Dim maxHeight = CInt((10000 / qsWidth))
Dim pageHeight = Math.Min(qsHeight, maxHeight)
Dim rowsPerPage = New NxPage With {
.Top = 0,
.Left = 0,
.Width = qsWidth,
.Height = pageHeight
}
Dim DataPages As IEnumerable(Of IEnumerable(Of NxDataPage)) = qsPager.IteratePages({rowsPerPage}, pageTransform:=Pager.Next)
Anyone has any idea of what's going on? Any help or hint will be appreciated. Thanks a lot! 🙂
Catalin
Hi! I don't know much about Visual Basic, but "Pager.Next" is a function. I'm not sure what the best way to pass functions as arguments is i in VB, but at least it seems to compile if you write like this:
Dim DataPages = qsPager.IteratePages({rowsPerPage}, pageTransform:=Function(p) Pager.Next(p))
I was wondering, could it be because my object is Table type?
Dim obj As Qlik.Sense.Client.Visualizations.Table = app.GetObject(Of Qlik.Sense.Client.Visualizations.Table)(objectid)
Dim qsPager = obj.GetHyperCubePager("/qHyperCubeDef")
The parameter for Pager.Next, according to the docs, is a collection of NxPages. But isn't the collection defined at this point:
Dim DataPages As IEnumerable(Of IEnumerable(Of NxDataPage)) = qsPager.IteratePages({rowsPerPage}, Pager.Next)
Hi! I don't know much about Visual Basic, but "Pager.Next" is a function. I'm not sure what the best way to pass functions as arguments is i in VB, but at least it seems to compile if you write like this:
Dim DataPages = qsPager.IteratePages({rowsPerPage}, pageTransform:=Function(p) Pager.Next(p))