This is my first post to BOB.Please appologize for any inconvinience if my message is not to the standards expected.
I am completely new to writing macros,but I need to write a macro which can populate the following and put the result in excel sheet.
The following to collect with macro:
For each bo report , collect
Report name
Data provider(s) name
Universe(s) name
Object name/id
SQL Expression
can somebody please help me out writing the code?Though I see the code to copy the dp’s but again I am looking for something where the code can get all of the above at one place i.e into excel.
I think you need to add another sub (subroutine) to first retrieve all (or selected) coprorate documents and save them to the same folder as that document from Dwayne.
And the end of that subroutine youl probably just need activedocument.Refresh
Here is the Code I found from BOB to retrieve the corporate documents from the repository:
Dim BOApp As busobj.Application
Dim bodocs As busobj.Documents
Dim Document1 As busobj.Document
Set BOApp = busobj.Application
Set bodocs = BOApp.Documents
Set Document1 = bodocs.OpenFromEnterprise(“empgroup PROD Xi”, “EmpGrp”, boFolder)
Document1.Refresh
Document1.PrintOut
Dim file_name As String
file_name = “\xxx-dept\Egr” + empname + " " + CStr(Format(Date, “yyyymmdd”))
Document1.SaveAs (file_name)
Set bodocs = Nothing
Set Document1 = Nothing
My requirement is to get the all the corporate docs from the repository and save it to the user docs locally.As far as my knowledge goes I guess it is retriving only one doc but I need multiple.Please help me with the code.
I am looking for somehting generalized form of above code,specifying the source and destination ,so that I can tie with the Dwayne code.
@rsekar: check the references in VB. Did you use the correct version (Xi/6.5) ?
@sgummadi: I can’t find code to retrieve the corporate document list (well, not directly with BO VBA objects). The only thing I can find is people using hard coded document lists. The other which would work on 6.5 is read the database but it looks like you’re on Xi so that doesn’t work if I’m correct.
And I don’t have Xi to test here…sorry.
@rsekar: you should gave started a new topic since this has nothing to do with this topic. Or contact Dwayne, he seems to be the author of the code.
Try debuging it step for step, which object fails to create ?
Thanks much Dwayne and Gerard for getting me upto this point.I did see that hard coding for the document names to get the list but again it does not solve the purpose.I found this in my search so is this URL can get my job done?or am I going out of way?
Also I read in the BOB forums that it is not possible to get the object id/Internal id for the object using report SDK,there was something like ‘ID’ in hidden in the object class under Designer SDk to get that object info.My question if it is hidden how can I use that in coding?Any thoughts or ideas please?
The coding given in the url works for version 6.5 and earlier, so it depends on what version you’re on. I believe you can’t read the database anymore on Xi but I haven’t done any work on that.
The same goes for the object id, it’s there in the repository tables for 6.5 and earlier.
Thanks Gerard for the Prompt reply.I am using 6.5.So can I use the code safely to import the docs from the repository?
Also can you assist me in getting the objectid info for the objects in the universe.I tried to write code but ID is hidden under object class ,it is not visible to put in the code.Any thoughts please?