REM ***** BASIC ***** sub main dim oDBS as variant dim oConn as variant dim oReport as variant oDBS = OpenDatabase( "Fuel" ) oConn = getConnection( "Fuel" ) oReport = OpenReport( oDBS.DataBaseDocument.ReportDocuments, oConn , "Report1", "open" ) wait 5000 oReport.close( true ) oReport = OpenReport( oDBS.DataBaseDocument.ReportDocuments, oConn , "Report1", "edit" ) wait 5000 oReport.close( true ) end sub function OpenReport( reportContainer as variant, oConnection as variant, sFormName as string, strMode as string) as variant Dim aProp(1) As New com.sun.star.beans.PropertyValue aProp(0).Name = "ActiveConnection" aProp(0).Value = oConnection aProp(1).Name = "OpenMode" aProp(1).Value = strMode OpenReport = reportContainer.loadComponentFromURL(sFormName,"_blank",0,aProp()) end function function getConnection( dbRegName as string ) dim oConnection dim IHandler IHandler = createUnoService("com.sun.star.sdb.InteractionHandler") oConnection = CreateUnoService("com.sun.star.sdb.DatabaseContext")._ getByname( dbRegName )._ ConnectWithCompletion(IHandler) getConnection = oConnection end function function OpenDatabase( dbName as string ) as variant dim oDBCntxt dim oDBSrc oDBCntxt = CreateUnoService("com.sun.star.sdb.DatabaseContext") oDBSrc = oDBCntxt.getByName(dbName) OpenDatabase = oDBSrc end function