Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

qlik sense accessing charts in qlik app c#

Hi all,

I want to access each and every graph inside qlik sense app by using .netSDK. I am new to c# If someone could help me with the sample code(easy to understand) that'll be great.

14 Replies
ruanhaese
Partner - Creator II
Partner - Creator II

Change the child back to myObject

then before the "first10RowsPage" add

GenericObject myObject = (GenericObject)child;     //converts it from an IGenericObject to GenericObject which contains Hypercubes

Seems to get something to work, but also still playing around with it myself

foreach (IGenericObject child in AppSheet.Children)
       {
          

Console.WriteLine(child.Info.Type, child.Info.Id);

GenericObject myObject = (GenericObject)child;

var first10RowsPage = new NxPage {

     Top = 0, Left = 0, Width = 10, Height = 10

};

IEnumerable<NxDataPage> data = myObject.GetHyperCubeData(/qHyperCubeDef”, new [] { first10RowsPage });

               }

Anonymous
Not applicable
Author

I am getting error..I guess it is not able to find the path "/qHperCubeDef" error.PNG

ruanhaese
Partner - Creator II
Partner - Creator II

Check your spelling on "qHperCubeDef"

Anonymous
Not applicable
Author

It is correct "/qHyperCubeDef". I did spelling mistake in my last reply but in my code it is correct.

Øystein_Kolsrud
Employee
Employee

Not all objects have hypercubes, and since you are traversing all objects of an app, I would think it quite likely that you have run into one that doesn't. The pager class is quite useful for interacting with hypercubes (and list objects). You could do something like this instead:

var pager = myObject.GetAllHypercubePagers().FirstOrDefault();

if (pager != null)

  var data = pager.GetData();

More information can be found here:

IGenericObject.GetAllHyperCubePagers Method

Paging of data ‒ Qlik Sense Developers

And here (but considering your example, I'd guess you've already seen this):

Retrieving data ‒ Qlik Sense Developers