Re: [dba-dev] How to "load" a SRB report from his com.sun.star.comp.report.OReportDefinition

2010-02-19 Thread Drew Jensen

Fernand Vanrie wrote:

Frank

as told on d...@api i have still some 2 minor questions

as soon my code is complete i will postit here, there are a few 
extentions around (like Drew' ReportRunner) who also can take 
advantage of this new knowledge


huh - I almost forgot...just might spur me to action actually...I'll be 
looking forward to this.




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



Re: [dba-dev] How to "load" a SRB report from his com.sun.star.comp.report.OReportDefinition

2010-02-19 Thread Fernand Vanrie

Frank

as told on d...@api i have still some 2 minor questions

as soon my code is complete i will postit here, there are a few 
extentions around (like Drew' ReportRunner) who also can take advantage 
of this new knowledge


Thanks

Fernand

Hi Fernand,

  
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 



See our thread over there in d...@api. As I explained there, I think this
is a side effect of the macro handling, as it does not happen when the
document does not contain macros (and thus you're not asked for macro
execution). Also, I outlined there how the API *should* be used to reach
your goal - in particular, one should be able to pass the filter to a
loadComponentFromURL call at the "reports" object.

Ciao
Frank

  



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



Re: [dba-dev] How to "load" a SRB report from his com.sun.star.comp.report.OReportDefinition

2010-02-19 Thread Frank Schoenheit, Sun Microsystems Germany
Hi Fernand,

> 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 

See our thread over there in d...@api. As I explained there, I think this
is a side effect of the macro handling, as it does not happen when the
document does not contain macros (and thus you're not asked for macro
execution). Also, I outlined there how the API *should* be used to reach
your goal - in particular, one should be able to pass the filter to a
loadComponentFromURL call at the "reports" object.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer frank.schoenh...@sun.com -
- Sun Microsystems  http://www.sun.com/staroffice -
- OpenOffice.org Base   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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



Re: [dba-dev] How to "load" a SRB report from his com.sun.star.comp.report.OReportDefinition

2010-02-18 Thread Fernand Vanrie

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



[dba-dev] How to "load" a SRB report from his com.sun.star.comp.report.OReportDefinition

2010-02-17 Thread Fernand Vanrie
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