Frank ,
I was a bit to hasty yesterday, there is still a problem: oreport =
oreports.getbyname("Jobbons1")
oReport has no component !
then i do oReport.load wath result in trow Exception
but with using "on local error resume Next"
the system ask if its ok with the macro's in the DB doc
and i endup with a component in the Report
way ?
For the completnes te new code:
Sub runReport
on local error resume next' needed to overcome the the exception
on oReport.open
dim Arguments(2) as New com.sun.star.beans.PropertyValue
context = createUnoService("com.sun.star.sdb.DatabaseContext")
oDataBase = context.getByName("mysql_native")
oDBDoc = oDataBase.DatabaseDocument
oReports = oDBDoc.getReportDocuments()
' msgbox oReports.dbg_methods
Arguments(0).Name = "OpenMode"
Arguments(0).Value = "open"
Arguments(1).Name = "ActiveConnection"
Arguments(1).Value = oDatabase.getConnection("user","paswordt")
Arguments(2).Name = "Hidden"
Arguments(2).Value = false
oreport = oreports.getbyname("Jobbons1")
oreport.open ' needed to have a component in Oreport >>>>trows a
exception there for the "resume next" <<<<<<
oreportComponent = oreport.component
oreportComponent.Filter = "pmgdbase.mag_jobs.JOBNR LIKE 'MMTbe%'"
oReports.loadComponentFromURL("Jobbons1","_blank",0,Arguments())
End Sub
Frank,
Sorry i had the solution right before my nose :-)
its not load , but loadcomponentfromURL
Sub Main
dim Arguments(2) as New com.sun.star.beans.PropertyValue
context = createUnoService("com.sun.star.sdb.DatabaseContext")
oDataBase = context.getByName("mysql_native")
oDBDoc = oDataBase.DatabaseDocument
oReports = oDBDoc.getReportDocuments()
' msgbox oReports.dbg_methods
Arguments(0).Name = "OpenMode"
Arguments(0).Value = "open"
Arguments(1).Name = "ActiveConnection"
Arguments(1).Value = oDatabase.getConnection("user","pasword")
Arguments(2).Name = "Hidden"
Arguments(2).Value = false
oreport = oreports.getbyname("Jobbons1")
oreportComponent = oreport.component
xray oreportComponent
oreportComponent.Filter = "pmgdbase.mag_jobs.JOBNR LIKE 'MMTbe%'"
oReports.loadComponentFromURL("Jobbons1","_blank",0,Arguments())
>>>>>here i still need to close the connection <<<<<<<<
End Sub
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org