Hi Frank,
Frank Schönheit - Sun Microsystems Germany schrieb:

For forms and reports, the document (the XModel) is under the control of
the css.sdb.DocumentDefinition, which you got (didn't you) when you load
the object. In particular, it's the DocumentDefinition's responsibility
to close the document, not yours.

The DocumentDefinition has a member execute (from
css.ucb.XCommandProcessor, see the IDL reference, please), which accepts
a command named "shutdown" to close the associated form/report.

Seems to be a little bit tricky in BASIC.
The DocumentDefinition I get from the collection of reports.
The loadedReport is an XTextDocument which doesn't support the latter service.
The shutdown command fails (UnsupportedCommandException).

Here's the snippet:

form = ThisComponent.DrawPage.Forms(0)
reports = ThisComponent.getParent.getReportDocuments()
connection = ThisComponent.DrawPage.Forms(0).ActiveConnection

Dim props(1) as new com.sun.star.beans.PropertyValue
props(0).Name = "ActiveConnection"
props(0).Value = connection
props(1).Name = "Name"
props(1).Value = sReportName

documentDefinition = reports.createInstancewithArguments("com.sun.star.sdb.DocumentDefinition",props())

Dim aProp(1) as new com.sun.star.beans.PropertyValue
aProp(0).Name = "ActiveConnection"
aProp(0).Value = connection
aProp(1).Name = "OpenMode"
aProp(1).Value = "open"

report=reports.loadComponentFromURL(sReportName,"_blank",0,aProp())

n = documentDefinition.createCommandIdentifier()

Dim  aCommand as new com.sun.star.ucb.Command
aCommand.Name = "shutdown"
aCommand.Handle = -1
documentDefinition.execute(aCommand,n,null)

Regards

Peter

--
WindowsXP , OpenOffice 2.2






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to