Frank Schönheit - Sun Microsystems Germany schrieb:
Hi Peter,
Seems to be a little bit tricky in BASIC.
The DocumentDefinition I get from the collection of reports.
...
The shutdown command fails (UnsupportedCommandException).
...
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())
Don't have the chance to try this out myself right now, but I think this
should be a mere
documentDefinition = reports.getByName( sReportName )
resp.
documentDefinition = reports.getByHierarchicalName( sReportName )
I would have expected your code to raise an exception, since what it
actually does is creating a new doc definition with the name of an
already-existent one.
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())
Since you have the document definition, anyway, you could also "execute"
an "open" command at it - this will have the same result, without the
need for the additional property hassle.
yes, works like a charm.
n = documentDefinition.createCommandIdentifier()
Dim aCommand as new com.sun.star.ucb.Command
aCommand.Name = "shutdown"
aCommand.Handle = -1
documentDefinition.execute(aCommand,n,null)
That part looks fine.
and works fine with 2.4.
The version 2.2 seems to be buggy and doesn't support the command.
The "close"-command doesn't work with dev300_m3.
Regards
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]