8 Replies Latest reply: Jan 22, 2015 6:46 AM by Shane Porter RSS

    .NET SDK Master Object Column Order

      Hi all,


      I have a table in the master library.  It has 8 columns, and an ID of 'vgJLah'.


      I have the following code, where 'app' is an IApp instance.


      IMasterObject masterObject = app.GetMasterObject("vgJLah");
      var masterObjectData = masterObject.GetHyperCubeData("/qHyperCubeDef", new[] { new NxPage { Height = 1000, Width = 8 } });


      This gets me the data, but I notice that the columns are not in the same order as the object in sense.


      So - 2 questions:


      1. Why are the columns not returned in the same order, and can this be resolved with a code change?

      2. Is there any way to retrieve the headings too?




        • Re: .NET SDK Master Object Column Order

          In version 1.0 there is limited support for Master Objects. If you want to read the properties for the "mastered"  object you will have to access the linked object on the sheet and retreive it as its type (in this case Table).

          ie. sheet.GetTable("myLinkedObjectID").Properties.


          1. The colums are retrieved in the order of the definition (hypercubedef), the client uses a property called columOrder which indicates the presentation order.
          There are severeal ways you can handle this
          - get the data and then sort the retreived columns by the property columnOrder
          - GetHyperCubeData with multiple pages one page per column. Set page.right and page.left property according to the property columnOrder.


          2. The heading can be retrieved thru the definition (hypercubedef), i.e. table.Properties.HyperCubeDef.Dimensions.First().Def.FieldDefs.First(). note the limited support of master obejct in version 1.0.


          Best Regards
          Lars-Göran Book