Hi Fernand,

> I hope Frank S. is there :-)

well, yes.

> I try to load in the beamer data with a SQL statement and not data from 
> a datasource tabel loaded with the GUI
> even when i not use a SQL statement and try to load the data from a 
> datasource tabel the Beamer stays empty.
> Only when the beamer was opened with the GUI the SQL statement works 
> then as a "filter" with rows who coresponded to the SQL statement ???

Your method of setting properties at an existing data source browser's
(DSB) model is not correct. Your code basically retrieves the
css.sdb.RowSet facet of the DSB, and sets some properties. Effectively,
this is fiddling with the implementation details of the DSB.

The DSB implements the css.sdb.DataSourceBrowser service, documented at
http://api.openoffice.org/docs/common/ref/com/sun/star/sdb/DataSourceBrowser.html.
(Looking at it - the documentation sure could be much more explicit in
various respects. Any volunteer to write a DevGuide chapter?)

Basically, what you need to do:
- don't dispatch a .uno:ViewDataSourceBrowser command, instead use
  the loadComponentFromURL of the frame of the current document.
  Pass "_beamer" as the frame name, and ensure to also pass the
  FrameSearchFlag.CREATE flag, so the beamer is created when needed.

- Pass the DataSourceName/Command/CommandType as arguments to the
  loadComponentFromURL call, they will be forwarded to the DSB's
  initialize method (which speaking strictly is an implementation
  detail, too, but halfway documented in the above IDL ref).

- If you really want to change what's displayed in an already-existent
  DSB, use the XSelectionSupplier interface. (Damn, that's not
  documented in the IDL ref! Will fix.). Pass the
  DataSourceName/Command/CommandType as sequence of NamedValues to
  the select method.

Hmm, and since indeed Filter/ApplyFilter are not supported, neither when
the DSB is initially loaded, nor when you use Select ... I fear your
only chance of getting this in fact *is* fiddling with the internals.

Once you did the above (which is necessary, since it's the only way to
ensure the grid displayes the proper columns), you can set the
Filter/ApplyFilter at your oModel, and then do a "reload" at it. Nothing
more than this, please :)

If you care to submit an issue requesting that the Filter/ApplyFilter
(and for consistency: all other relevant properties of a
css.sdb.DataAccessDescriptor) should be supported in both .initialize
and .select, then I might care to implement this :)

Thanks & Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Base                       http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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

Reply via email to