Frank Schoenheit, Sun Microsystems Germany wrote

If you have a connection, and *know* that it comes from a DataSource,
then getParent of this connection will give you the data source. A data
source, then, can be asked for its associated database document
(XDocumentDataSource.getDatabaseDocument). The document then has the
forms/reports collection, providing access to the
css.sdb.DocumentDefinition objects. A DocumentDefinition, finally, has
an "open" method.
thats the way i was trying to open reports (see also my post on d...@dba)

the "open" method only works because i opened by accident manualy the DB doc

and have you a explanition for fact that at first run the flowing code gives a com.sun.star.comp.dba.ODocumentDefinition but with a EMPTY component

 ocontext = createUnoService("com.sun.star.sdb.DatabaseContext")
 oDataBase = ocontext.getByName("mysql_native")
 oDBDoc = oDataBase.DatabaseDocument
  oReports = oDBDoc.getReportDocuments()
  oReport = oreports.getbyname("MySRBreport")
after rerunning i have also the component
oreportComponent = oreport.component ' gives me a ReportDefinition where is can change the Filter String
oreportComponent.Filter = "pmgdbase.mag_jobs.JOBNR LIKE 'MMTbe0130%'"

oReport.open 'Run a report with the wanted Filter Conditions if the DB doc is open o the desktop

greetz

Fernand


This is true before and after the change which you replied to.

If you know what you're doing, using this path is perfectly legitimate.
However, the way via the XDatabaseDocumentUI (implemented by the
controller of the database document) is usually to be preferred: If the
user closes the database document, then all sub documents opened/created
via XDatabaseDocumentUI will be closed, too. In this sense, the
interface really only provides convenience shortcuts for actions the
user can do in the UI.

Tampering with the document definitions (and other low level objects)
directly is possible, but gives you who you're doing this the
responsibility for life time etc.

Ciao
Frank



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to