Actually there is one simple way to change ownership from admin to some user. It depends on system security. We can save report as ORIGINAL_NAME+CHANGE, then delete report with ORIGINAL_NAME. FInaly ask user to open report ORIGINAL_NAME+CHANGE and rename it back to ORIGINAL_NAME.
Unfortunately this turn to be very annoying in case of renaming 40 reports
If you log in as Admin and don’t already have a personal account you will need to create one. In this case call it Shiva and make sure it has permission to save reports to the public folders.
Login as the Admin and send the report to the Shiva accounts Business Objects inbox. Make sure you send a copy and not a shortcut.
Login in as Shiva. Retrieve the report from your inbox and then publish the report to the relevant folder. The report owner will now show as Shiva.
I am developing a Java SDK code to change the owner of a report (any report, I will pass the name) to the username that I will pass to the program. I have a question. Hope someone can help me.
I could see that there are setDescription(), setTitle() methods using which one can easily set SI_DESCRIPTION & SI_NAME of a report. However, in my case, I want setOwnerID() to be there. Is it present? Meaning, can I change the owner of a report by using setOwnerID(NewUser) ?
If yes, great I will try. If not, what are my options?
There is no method (I believe) to change the owner ID directly. That’s somewhat surprising because I don’t see changing the owner as an exotic action. Anyway, you can change the owner by accessing the property bag directly as in this example:
thank you “my bff jill”
I think you are right. I tried doing getOwnerID() and that did not work, so I tried setOwnerID() and as expected, it did not work either. So there is no easy way to set Owner as one would set name/description.
I think the method you suggested would work. I would wait for our environment to be available so I test it.
By the way, I have always wondered, where did you find that
Hmmm…I think I picked up on the setProperty() method of setting object properties when I started using the SDK a few years ago. I likely spotted a piece of code on BOB and emulated the method for the attributes I did not know how to manipulate. While this does work, it is much slower than calling the proper method if one is available especially for nested properties (e.g. getTitle() is faster than .properties.getProperty(…)). I used to think that was the only way to manipulate objects until I leafed through the Developer Library.
Edit
On second thought, I do recall seeing this described in the R2 Developer Guide:
Was a solution ever found for an easy way to change the owner of bulk objects? (Say a few dozen WEBI reports and Xcelsius published Flash objects).
I created everything under my ID as a developer/admin, but I’ve been asked to change the owner from my ID, to the company Name instead since these will be seen by external clients.
I’ve created an account with our Company name as the Account name but short of opening each one up and resaving, I wonder if there is an easier way?
One option i’m debating with, is to simply rename the Admin account to the company name… then delete my personal account ID. That will revert all owners to the admin ID.
Furthermore, since I don’t use favorites and I’m the admin with full password access, I could just login under the new administrator ID to create any new reports.
Even though I’m the admin and really the sole developer at this point, I somehow don’t feel comfortable with using the Admin ID in this fashion, as I’m sure it’ll cause an issue down the road.
I’m wondering if that Java SDK mentioned by Buddy above was ever developed, or if perhaps the LCM might have an option to change owner name when migrating from a Dev/QA environment to a production.
I saw your post just now. Yes I successfully came up with a code that takes access details, report name and new owner’s bo username and changes the owner of the report to that username.
I shall share the code with you tomorrow when I go to work…(don’t have it with me right now)
But as you said, I think it’s not a bad idea just to rename your username to company name, that way you don’t have to keep changing the owner of each and every report. You wil have to do that via SDK itself though.
I leave it upto you what you want to do…
sourceUser = (IInfoObjects) iStore.query("select * from ci_infoobjects where si_id=" + repID);
for ( int i = 0; i < sourceUser.getResultSize(); i++ ) {
oSourceUserObject = (IInfoObject)sourceUser.get(i);
//oSourceUserObject.properties().setProperty("SI_OWNERID",ownerID); //set new Name/ID
//oSourceUserObject.properties().setProperty("SI_OWNER","Administrator"); //set new Name/ID
oSourceUserObject.properties().setProperty(CePropertyID.SI_OWNERID,ownerID); //set new Name/ID
oSourceUserObject.properties().setProperty(CePropertyID.SI_OWNER,"Administrator"); //set new Name/ID
}
iStore.commit( sourceUser );
As you can see, I’ve tried several different ways, but that change never gets made.
Only SI_OWNERID works. The SI_OWNER field is dynamic and its value is derived from SI_OWNERID. Also, try oSourceUserObject.save() instead of iStore.commit( sourceUser ).
Tried that, still no change. I should mention this is XI3.1, not R2.
I didnt know where the save should go, so I put it before and after loop.
sourceUser = (IInfoObjects) iStore.query("select * from ci_infoobjects where si_id=" + repID);
for ( int i = 0; i < sourceUser.getResultSize(); i++ ) {
oSourceUserObject = (IInfoObject)sourceUser.get(i);
//oSourceUserObject.properties().setProperty("SI_OWNERID",ownerID); //set new Name/ID
oSourceUserObject.properties().setProperty(CePropertyID.SI_OWNERID,ownerID); //set new Name/ID
oSourceUserObject.save();
}
oSourceUserObject.save();