BusinessObjects Board

Updating Universe thru SDK in XI

Hello,

I’m working on a project where I need to be able to update the information in a universe thru a .Net application. Specifically, I’m looking to be able to change an object name based upon information entered by the user (for example: change an object named ‘Claim No’ to ‘Claim Number’).

I’ve got the SDK up and running and have gone thru some of the samples. None of the samples that I can find do anything with Designer, though. It’s all InfoView type of stuff.

Can anyone point me in the right direction?

Thanks,

Alan


ajunell :us: (BOB member since 2004-05-03)

The Designer SDK is only available in a COM version. You can create a wrapper and make it available to a .NET application though. As far as a sample, this topic might be of interest.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Thanks Dwayne. I guess my problem is that I don’t really know where to start. I’ll take a look at the sample you pointed me to and see if I can figure out where to go from here.

Thanks,

Alan


ajunell :us: (BOB member since 2004-05-03)

OK…Maybe I’m missing something obvious here. The sample that you pointed me to seems pretty easy to follow what it’s doing. But I can’t seem to get my Visual Studio Project setup so that I can access any of the Designer.* objects. I’m importing BusinessObjects.Enterprise.Desktop, BusinessObjects.Enterprise.Desktop.Designer, BusinessObjects.Enterprise.Desktop.Universe, CrystalDecisions.Enterprise,
CrystalDecisions.Enterprise.InfoStore. None of those will let me to the Designer objects.

Any idea what I’m missing?


ajunell :us: (BOB member since 2004-05-03)

Yes, those are .NET assemblies. What you are looking for is a COM component. In Solution Explorer, right-click on the project name and select Add Reference… Here is the important part. Select the COM tab, not the .NET tab. You’ll find BusinessObjects Designer in the list.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Thanks Dwayne. I knew it had to be something simple. I’m very new to VS .Net and never even noticed that tab before.

Thanks again,

Alan


ajunell :us: (BOB member since 2004-05-03)

OK…I’m making progress but still having problems. I was able to use Dwayne’s sample code to create a very basic Windows Application in Visual Studio that will update the object description in a universe. This piece works just fine. What I really need to be able to do is perform the same function from a .Net Web Application. When I use the exact same code in my Web Application that I was using in the Windows application, I get an ‘Access is Denied’ message that says ‘ASP.NET is not authorized to access the requested resource’. The error is occuring when I try to create a new reference to the Designer.Application object (marked below)


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Dim DesignerApp As Designer.Application
        Dim Univ As Designer.Universe

        DesignerApp = New Designer.Application  ' *** This is the line throwing the error message
        'DesignerApp.Visible = True
        Call DesignerApp.LogonDialog()

        Univ = DesignerApp.Universes.Open("@WS299.CORPSYS.CSEDGE.COM/Alan - Test/Universe1.unv")
        'DesignerApp.Visible = False

        Call GetObjectInfo(Univ.Classes)

        Univ.Save()

        DesignerApp.Quit()
        DesignerApp = Nothing


    End Sub

    Public Shared Sub GetObjectInfo(ByVal Clss)
        Dim Cls As Designer.Class
        Dim Obj As Designer.Object
        Dim RowNum As Integer

        For Each Cls In Clss
            For Each Obj In Cls.Objects
                RowNum = RowNum + 1
                Obj.Description = Cls.Name & "-" & Obj.Name
                If RowNum > 20 Then
                    Exit For
                End If
            Next Obj
            If Cls.Classes.Count > 0 Then
                Call GetObjectInfo(Cls.Classes)
            End If
        Next Cls
    End Sub

I’ve gone thru and given the ASPNET account full permissions to the Business Objects directories and the wwwroot directory where the web application is stored (as recommended by the details of the error message). I’ve done the same with the IUSR_ and IWAM_ accounts with no luck.

Is this really a permissions issue, or does it have something to do with the way that I’m trying to use the COM objects inside a .Net Web Application? I did include the Business Objects Designer COM in my references. It appears to have recognized it, because the ‘auto-complete’ function is working properly and showing all the expected properties and methods for the various objects.

As I’ve said before, I’m new to all of this and am just trying to feel my way thru, so I appreciate your help.

Thanks,

Alan


ajunell :us: (BOB member since 2004-05-03)

Hi Alan,

Quick question is when i open visual studio 2005 i don’t see business objects designer in com object. How did you get that dll did you imported that from some where?

Thanks


dwmdbth (BOB member since 2005-09-07)

If you have Designer installed on the same machine, it should be there. The instructions for referencing it in your project were in this previous post.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Dwayne,

Thanks for following up on the question from dwmdbth for me. Any idea what I might be doing wrong on my current issue?

Alan


ajunell :us: (BOB member since 2004-05-03)

Not a clue. I haven’t used Visual Studio with any COM libraries, and certainly not with any BusObj COM libraries.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Well…After much pain and suffering, I figured out how to correct the ‘Access is Denied’ message I was getting trying to instantiate a new COM object. The resolution was to use the identity tag in web.config shown below:

<identity impersonate="true" />

What this does is cause the ASP application to run as your local user account, with all it’s associated privileges. So you need to evaluate any security issues involved with that. There is a pretty good article from Microsoft that discusses this at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/THCMCh19.asp

Alan


ajunell :us: (BOB member since 2004-05-03)

Alan,

Earlier you have mentioned that you wrote code to update the description field in universe. I just curious to know what are the steps you took. Whether you created .net code in Excel spreedsheet and that updated the description or you kept excel spreedsheet open and ran your code in Visual studio.

Thanks


dwmdbth (BOB member since 2005-09-07)

My code is in one of the posts above. My version is not reading the excel spreadsheet. It basically just sets the object description to be a combination of the class name and object name.


ajunell :us: (BOB member since 2004-05-03)

Thanks for your reply. I am getting error as “unable to open universe”. I am just wondering did you created folder and saved universe on the server. If yes then where we have to create this folder.

Thanks for help.


dwmdbth (BOB member since 2005-09-07)

Thanks for your reply. I am getting error as “unable to open universe”. I am just wondering did you created folder and saved universe on the server. If yes then where we have to create this folder.

Thanks for help.


dwmdbth (BOB member since 2005-09-07)

You may have to fully qualify the path to your universe. Something like:

Univ = DesignerApp.Universes.Open("C:\Documents and Settings\ajunell\Application Data\Business Objects\Business Objects 11.5\universes\@WS299.CORPSYS.CSEDGE.COM\Alan-Test.unv")

If you are using the

DesignerApp.Universes.Import("", "Alan-Test")

command, you’ll have to check your settings in Designer to see where the import command places the universe.


ajunell :us: (BOB member since 2004-05-03)

Thank you very much your solution worked. I am progressing, now i am getting “unable to evaluate expression” for Cls.name, Obj.name when i run this code in debug mode.

Appriciate your help.


dwmdbth (BOB member since 2005-09-07)

I’m not sure. Sounds kind of like a syntax error somewhere. You might check and make sure that Cls and Obj are defined as:


Dim Cls As Designer.Class 
Dim Obj As Designer.Object 

ajunell :us: (BOB member since 2004-05-03)

Moving to SDK forum.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)