Thanks
Code: Select all
Sub OpenMyReport(oEvent As Object)
Dim RptName as string
RptName = "Date Query"
'the name of the report I want to open
ThisDatabaseDocument.ReportDocuments.getByName(RptName).open
End Sub
Code: Select all
Sub OpenMyReport(oEvent As Object)
Dim RptName as string
RptName = "Date Query"
'the name of the report I want to open
ThisDatabaseDocument.ReportDocuments.getByName(RptName).open
End Sub
Code: Select all
Sub OpenReportByTag(oInitialTarget As Object)
Dim oSource As Variant
Dim oModel As Variant
Dim oParent As Variant
Dim oActiveConnection As Variant
Dim oParent2 As Variant
Dim oDatabaseDocument As Variant
Dim oReportDocuments As Variant
Dim sRepName, oReport
oSource = oInitialTarget.Source
oModel = oSource.getModel()
sRepName = oModel.Tag
oParent = oModel.getParent()
oActiveConnection = oParent.ActiveConnection
oParent2 = oActiveConnection.getParent()
oDatabaseDocument = oParent2.DatabaseDocument
oReportDocuments = oDatabaseDocument.getReportDocuments()
oReport = oReportDocuments.getByName(sRepName)
oReport.open()
End Sub
now you can be 100% sure ...Villeroy wrote:I'm 90% sure ...
Code: Select all
Sub OpenReportByTag(Event As Object)
Dim oParms(0) As New com.sun.star.beans.PropertyValue
oButton = Event.Source.Model
sRepName = oButton.tag
oParent = oButton.Parent
oActiveConnection = oParent.ActiveConnection
oDatabaseDocument = oActiveConnection.Parent.DatabaseDocument
oReportDocuments = oDatabaseDocument.ReportDocuments
oParms(0).name = "ActiveConnection"
oParms(0).value = oActiveConnection
ocomponent = oReportDocuments.loadComponentFromURL(sRepName, "", 0, oParms())
End Sub