Hallo,
I hope Frank S. is there :-)

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 ???

my code:

dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
frame1 = thiscomponent.CurrentController.Frame
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ViewDataSourceBrowser"
args1(0).Value = true
dispatcher.executeDispatch(FRame1, ".uno:ViewDataSourceBrowser", "", 0, args1()
frame2 = frame1.findFrame("_beamer",4) 'get DataBrowser frame
IF IsNull(frame2) then
         MsgBox("Beamer niet gevonden !", 16)
         Exit_dialog
         end
   END IF
   oDataSourcebrowser = frame2.Controller

' the DataSourceBrowser object has several getModel methods
' choose getModel from interface com.sun.star.awt.XTabController
' to get the form used by DataSourceBrowser
   oModel = oDataSourcebrowser.com_sun_star_awt_XTabController_getModel
   with oModel
    .SetPropertyValue( "ApplyFilter", false)
   .SetPropertyValue( "DataSourceName", "contacts" ) " the datasource
     .SetPropertyValue( "CommandType", 0 ) "use a Tabel
 .SetPropertyValue( "Command", "Contacts" '
' "SELECT * from Contacts WHERE Salutation like '%Mr%'" ' works a a filter when 'Contacts is slected with the GUI
end with
 oDataSourcebrowser.setmodel(oMOdel)
oModel.execute
' .load()  "dos nothing
' .next
' .parent

When cheking oModel everyting is set correctly but the beamer keeps the columns originaly selected by the GUI but EMPTY

thanks for any hint

Fernand


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

Reply via email to