If we can have this insertpoint we can put in it for instance a graph caught from a stock-market-webpage, and each time we launch the report we have updated data
Sub Hyperlink
'--------------------------------------------------------------------
' 0 We declare the variables
Dim oreportdoc As Object, ocontroller As Variant
Dim oTextTable As Variant, oCell As Variant
Dim oCurs As object, oText As Variant
'------------------------------------------------------------------------------
'1º We open our report
ocontroller = Thisdatabasedocument.currentController
if not ocontroller.isconnected then ocontroller.connect ' The connection
oreportdoc = Thisdatabasedocument.reportdocuments.getbyname("MyReport").open ' We open the report
oTexttable = oreportdoc.Texttables(0) ' The table we have inside the report
'-------------------------------------------------------------------------------
'2º We choose the cell
oCell = oTextTable.getCellByPosition(1, 2) ' Second column third row
oText = oCell.Text ' Text inside the cell
oCurs = oText.createTextCursor() ' We create a text cursor
oCurs.gotoEND(True) ' We select the entire text
oCurs.setString("Click here") ' We replace the pre-existing text
oCurs.gotoStart(False) ' We go to the start of the new text
oCurs.gotoEnd(True) ' We select all new text
oCurs.HyperLinkURL = "http://user.services.openoffice.org/en/forum/" ' We put the Hyperlink
End Sub
Users browsing this forum: No registered users and 4 guests