BusinessObjects Board

Changing objects only for some reports

HI: This is a two-part question.

Part ONE: We have approximately 3000 reports using objects common to all users. For just these 3000 reports, we want those common objects to point to a different place. We don’t want to affect anyone else. How can we do this?

Part TWO: One suggestion is to copy the universe into another universe in the same repository, change the objects in the new universe and then manually change the 3000 reports to use the new universe. These reports aren’t published. I know how to change each report, one by one, to point to a different universe. What other ways are available to me?

I did search the archives and if the answer is there, I didn’t understand it. :confused:

Thanks!


KSG :us: (BOB member since 2002-07-17)

Can you just change the universe so that the object is pointing to the different, correct place? If you can, don’t forget you can’t delete and re-add or your reports will break. Just edit the current object.

There’s a macro floating out there somewhere to do it… I’ll see if I can find it and post it for you…

Good luck!


JennFisher :us: (BOB member since 2002-06-25)

We don’t want the object to change for any other report. For all other reports, we want the object to still point to the old location. Is there any way to do this other than what’s outlined in my Part TWO?

Thank you!


KSG :us: (BOB member since 2002-07-17)

Ahh… I understand now. You might could write a macro to do it… speaking of…

Public UnvList As Universes
Sub ChangeUniverse()
Dim UnvCount As Integer
Dim UnvNameList() As String
Dim ix As Integer
Dim DefaultPath As String
DefaultPath = "C:\Folder_with_BODocuments"
Application.Interactive = False
Set CurDoc = Application.ActiveDocument
Set UnvList = Application.Universes
UnvCount = UnvList.Count
ReDim UnvNameList(UnvCount)
For ix = 1 To UnvCount
    UnvNameList(ix) = UnvList.Item(ix).LongName
    frmChoose.cboxFrom.AddItem (UnvNameList(ix))
    frmChoose.cboxTo.AddItem (UnvNameList(ix))
Next ix
frmChoose.txtPath.Value = DefaultPath
Application.Interactive = True
frmChoose.cboxFrom.ListIndex = 0
frmChoose.cboxTo.ListIndex = 0
frmChoose.Show

End Sub

I didn’t write this… and I can’t remember who I got it from (so claim it if it’s yours… :)). I think what you will want to do is put all the reports you want to change in the same folder and then set that folder as the default path in the code…

Good luck! :slight_smile:


JennFisher :us: (BOB member since 2002-06-25)

Ok, I understand about putting all the files into one folder (they are already there, so that makes it easy).

:oops: So ignorant question number THREE: How do I run this macro? I’ve never had to do a macro in BusObj before. Number FOUR: Where do I specify the new universe name?

Thank you so much–this will save me much time!


KSG :us: (BOB member since 2002-07-17)

Hmm… I just tried to run it quickly and it didn’t work… I can take a look at it later tonight, but if anyone else has similar code that can help you out faster, that’s fabulous. I KNOW a very active poster sent this to me…

Anyway, I’ll try to work it out and let you know later…


JennFisher :us: (BOB member since 2002-06-25)

It does not work, because you are missing the form that contains most of the code.
I’m emailing you the .rea file.

Oh, by the way, it was my program. :wink:


JF Cayron :us: (BOB member since 2002-08-15)

Karen, I could send you the add-in but you do not show an email address. :?
You can contact me offline if you prefer. :yesnod:


JF Cayron :us: (BOB member since 2002-08-15)

Jean-Francois:

Is this something that we can post in our “code library”? If so, please send a copy to Bob at busobj@forumtopics.com and I will post it. If your form is very complex, we may just have to post a link to a downloadable item, but it would be great if we can post the actual code for others to be able to use.

Dave


Dave Rathbun :us: (BOB member since 2002-06-06)

Karen: if we can’t get Jean-Francois’ code posted, the macro above can be rewritten so that you simply code the universe name into the macro code itself. That would be less flexible, but it can be done with a minimal amount of fuss.

Dave


Dave Rathbun :us: (BOB member since 2002-06-06)

Sure, the email is on its way.


JF Cayron :us: (BOB member since 2002-08-15)

Got it, will post it soon. I’ll come back here and put a link to the code sample once it’s up so that folks can find it easily.

Dave


Dave Rathbun :us: (BOB member since 2002-06-06)

Ah! Thanks for taking ownership! It’s a fab piece of code, 8) and I’m glad Dave’s going to post it in code samples.


JennFisher :us: (BOB member since 2002-06-25)

HI Jean-Francois: Thank you so much for the reply! I guess I’m secretive by nature (reading too many mysteries) so I hid my email address. Now it’s not hidden.

This will save me from hours of point-and-click conversion! :lol:


KSG :us: (BOB member since 2002-07-17)

Thanks to all! I obtained the relevant files from Jean-Francois and I was able to run it in my test environment. It did exactly what I needed! :smiley:

I have a question related to this. Pretend I’m not using the macro:

The universe is changed, the SQL reflects the changes, and the report is refreshed. Everything works fine!

If I change the universe without refreshing the report, will the SQL still be updated to reflect any changes in the new universe? I assume so because when I do change it manually, and check the dp, the SQL has been updated. Or is it updated BECAUSE I check the dp? :confused:

The reason I’m asking is because we really just want the SQL updated and we don’t need the report to be refreshed. The reports themselves will be refreshed as needed.


KSG :us: (BOB member since 2002-07-17)

The SQL is changed because you check the DP. If you just hit Refresh, it will run the SQL as it was last generated, against the connection that was last used. So, changes to either are not picked up until you enter the DP and close the Query Panel.

-RM


digpen :us: (BOB member since 2002-08-15)

I could use this code as well for a current project! Could someone send to me via e-mail? Or - if it will be added to the code library shortly - I can wait till then…from all the info on this forum - I am sure Dave is busy and I don’t want to seem impatient! :wink:

Thanks!


NStorey (BOB member since 2002-09-17)

I just sent the macro to you! It’s terrific :smiley:


KSG :us: (BOB member since 2002-07-17)

My humble apologies… the source document was sent to me some time ago, and I simply forgot to get it posted. I will attempt to do so this evening. :oops:

Dave


Dave Rathbun :us: (BOB member since 2002-06-06)

Code sample is now posted here


Dave Rathbun :us: (BOB member since 2002-06-06)