Skip to Content
author's profile photo Former Member
Former Member

Retrieving list of tables from universe using universe sdk in c# .net

Hello,

I wish to retrieve table information, create classes and objects in the universe using the universe sdk.

I am using Business Objects version XI 3 and vs 2005 c# .

My C# project as it stands uses the COM SDK component (i.e includes the BusinessObjects Designer 12.0 Object Library in its references [Interop.Designer]). I can open the universe and create classes and objects. However, I cannot get a list of tables currently existing in the universe. This works in VB i.e

Set ObjUniverse = ObjDes.Universes.Open(UniverseName)

For Each Tbl In ObjUniverse.Tables

Dim s As String

s = Tbl.Name

Next Tbl

but when I do it in C#, I get table not found....

for (int i = 0; i < Unv.Tables.Count; i++ )

{

Table tbl = Unv.Tables.get_Item(i);

string s = tbl.Name;

}

Can you please tell me how to get table information using c# with the com sdk?

Many Thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 22, 2008 at 04:17 PM

    I haven't used that SDK, but have you tried using a foreach loop to iterate through the collection rather than a for loop? There might be something awry with accessing the collection as an array.

    So,

    For Each Tbl In ObjUniverse.Tables

    Dim s As String

    s = Tbl.Name

    Next Tbl

    should translate to something like:

    ObjUniverse = ObjDes.Universes.Open(UniverseName);

    foreach (Table Tbl in ObjUniverse.Tables)

    {

    // do stuff with Tbl.Name ...

    }

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      thanks for reply.

      I've actually figured it out...little bit of a simple problem that took awhile to resolve. The zero position does not exist in the tables get_item method; it starts at 1. Hence the error. So the below works.

      for (int i = 1; i <= Unv.Tables.Count; i++ )

      {

      Table tbl = Unv.Tables.get_Item(i);

      string s = tbl.Name;

      } }

      B.T.W the complier doesn't like the foreach loop; says it can't getEnumerator for the tables object

      thanks

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.