I assume that is an object to access the table cells content in the base reports. Let me show you a piece of code ok ?
Code: Select all
Sub HyperLinkReportColumn()
dim form as object
dim view as object, table as object, cursor as object
dim item as string, dest as string, filter as string
dim cellsN as object, cellsS as object, dataN(), dataS(), x as integer, y as integer
form = ThisComponent.drawpage.forms(1)
dest = form.getByIndex(0).tag
view = ThisComponent.getCurrentController()
cursor = view.getViewCursor()
table = cursor.TextTable
if dest = "XX" then
cellsN = table.getCellRangeByName("B2:B" & table.rows.getcount & "")
cellsS = table.getCellRangeByName("F2:F" & table.rows.getcount & "")
elseif dest = "YY" then
cellsN = table.getCellRangeByName("B2:B" & table.rows.getcount & "")
end if
cellsN.setPropertyValue("BackColor", RGB(255, 255, 0))
dataN = cellsN.getDataArray()
dim RangeDataN(UBound(dataN),UBound(dataN)) as string
for x = 0 To UBound(dataN)
for y = 0 to UBound(dataN(x))
RangeDataN(x,y) = dataN(x)(y)
filter = filter & "" & chr(34) & item & chr(34) & " = '" & RangeDataN(x,y) & "'"
if dest = "Juegos" or dest = "Accesorios" then
RangeDataS(x,y) = dataS(x)(y)
filter = filter & " and ""Sistema"" = '" & RangeDataS(x,y) & "' or "
else
filter = filter & " or "
end if
next
next
End Sub
I want to access the tablegrid control content in a base form document, using the showing objects and methods in the up code.
Like i said i know that we can access the result set on the subform that contains the tablegrid control, but that way to access is slow, we have to loop each result. Also wanted to know if some of ppl here tested to access the own datagrid control content instead of the subform result set, with the intention to see if is faster...
OpenOffice last version | Mageia Linux x64 | Ubuntu Linux | Windows 8.1 Enterprise x64 | Java last version