4 Replies Latest reply: May 30, 2016 1:38 PM by Konrad Mattheis RSS

    Retrieve Column Headers

    Bernd Podhradsky

      Hi!

       

      I'm using the .NET SDK API and trying to retrieve all columns of a Table object. I'm aware of the ColumnOrder property, but which property do I need to access with these indices to get the column header labels?

       

      Thanks,

      Bernd

        • Re: Retrieve Column Headers
          Alexander Karlsson

          I'm no expert in the .Net SDK what so ever so excuse any errors on my part

           

          But speaking from a Generic Object spec point of view, the column headers are your labels defined in qDimensionInfo and qMeasureInfo. Then you match those against your ColumnOrder, i.e your dimensions and measure are defined and then column order defines sort and display order.

           

          If you are interested in what's returned you can look at http://help.qlik.com/en-US/sense-developer/2.2/Subsystems/EngineAPI/Content/GenericObject/LayoutLevel/HyperCube.htm

           

          So no .Net help but maybe you can work your way back from the HyperCube layout to a matching .Net SDK property

          • Re: Retrieve Column Headers
            Konrad Mattheis

            Hi Bernd,

             

            here some code snipets from my .NET Code:

             

            ll = genericSessionObject.GetLayout() as TableLayout;
            headerNames = (from c in ll.HyperCube.DimensionInfo select new HeaderItem() { Name = c.FallbackTitle, Dimension = true }).ToList();
            headerNames.AddRange(from c in ll.HyperCube.MeasureInfo select new HeaderItem() { Name = c.FallbackTitle, Dimension = false })
            

            ;

             

            You will receive the Data in the same order and you can use the columnsortorder to reassign that for the display of the data.

             

            bye Konrad

              • Re: Retrieve Column Headers
                Konrad Mattheis

                Hi Bernd,

                 

                you have to take care. The columnsortorder can be also NULL this meas: array {0..n-1} = {0},{1},...{n}

                The columnsortorder it over Dimensions and Measures, like I did this in my code. The first columns are

                the dimensions and the later one the measures. Just try it out you will see it in the result.

                 

                bye Konrad