Ok i can been a bit more precice:

i Trie to "open" a SRB report, change his definitions like Filter etc.... and the run the Report.
i get it done but ........

Sub Run1
   context = createUnoService("com.sun.star.sdb.DatabaseContext")
   oDataBase = context.getByName("mysql_native")
   oDBDoc = oDataBase.DatabaseDocument
   oReports = oDBDoc.getReportDocuments()
   oReport = oreports.getbyname("MyReport")
   xray oReport
' xray tells us that we have here a com.sun.star.comp.dba.ODocumentDefinition but with a EMPTY component (who holds the ReportDefinition)

 >> Now i run again
 run2
endsub
Sub Run2
   on local error resume ' needen to overcome the Exception later on
    ontext = createUnoService("com.sun.star.sdb.DatabaseContext")
   oDataBase = context.getByName("mysql_native")
   oDBDoc = oDataBase.DatabaseDocument
   oReports = oDBDoc.getReportDocuments()
   oReport = oreports.getbyname("MyReport")
   oReport.open
' here the system ask confirmation that i ame awaire of macro's in the DatbaseDocument
' then i run in a Exeption.

>> I restart again
run3
end sub
Sub Run3
    context = createUnoService("com.sun.star.sdb.DatabaseContext")
   oDataBase = context.getByName("mysql_native")
   oDBDoc = oDataBase.DatabaseDocument
   oReports = oDBDoc.getReportDocuments()
   oReport = oreports.getbyname("MyReport")

 'oReport.open i do not needed for the moment:
'now xray told me that i have now a component in oReport
oreportComponent = oreport.component
xray oreportComponent ' gives me a ReportDefinition where is can change the Filter String etc.....
oreportComponent.Filter = "pMyDatabase.Mytabele LIKE  'Mycondition'"

' no store,  no comit , no nothing.......a wonder will happen

oReport.open 'the wonder: it Runs the report with the wanted Filter Conditions !!!

From here on the wonder continious it works just by running the third part

OK wonders do happen :-) but please can someone explain this behaviour ????

Thanks for some explainations

Fernand




I trie to make a macro who load and runs a SRB report, but changing the filter with data from the macro

i got to the com.sun.star.comp.report.OReportDefinition wher i can change the filter string but how can i "load" en "run " the report. Do i hav to "store the Definition back to the storage and reopen the reportDoc ?

ok i got so far:

Sub Main
   dim Arguments(2) as New com.sun.star.beans.PropertyValue
     context = createUnoService("com.sun.star.sdb.DatabaseContext")
   oDataBase = context.getByName("mysql_native")
   oDBDoc = oDataBase.DatabaseDocument
   oReports = oDBDoc.getReportDocuments()


   Arguments(0).Name = "OpenMode"
   Arguments(0).Value = "open"
   Arguments(1).Name = "ActiveConnection"
   Arguments(1).Value = oDatabase.getConnection("user","password")
   Arguments(2).Name = "Hidden"
   Arguments(2).Value = false
     oreport = oreports.getbyname("Myreport")
oreportComponent = oreport.component


   oreportComponent.Filter = "pmgdbase.mag_jobs.JOBNR LIKE 'MMTbe%'"
      Arguments(0).Name = "Hidden"
   Arguments(0).Value = false
>>>>>>> oreportComponent.load("Jobbons1",,,Arguments()) >>> 'here i fails to laod the report

'   here I can store the Definition
' and reload ?
' oReport = oReports.loadComponentFromURL("Jobbons1","_blank",0,Arguments()) >> is that te right way ??

End Sub

Thanks for any hint

Fernand


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org

Reply via email to