Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
prabhuappu
Contributor II

Not able to create new sheet using Qliksense SDK

Hi,

I tried to create  sheet using .Net SDK. But when i create a sheet it removes all the existing sheet. Below is the code that i used.

            ILocation LocalQliksense = Qlik.Engine.Location.Local;

            //Find an App with Name

            IAppIdentifier foundAppIdentifier = LocalQliksense.AppWithName("Retail Sales");

            IApp application = LocalQliksense.App(foundAppIdentifier);

            ISheet Sheet = application.CreateSheet("Sheet3");

            application.DoSave();

Please help to solve this.

Regards,

Prabhu Appu

1 Solution

Accepted Solutions
Not applicable

Re: Not able to create new sheet using Qliksense SDK

Hi,

I can see that you are creating the sheet without title and rank (position in the list). Try

Application.CreateSheet("Sheet3", new SheetProperties

  {

    Rank = 3,

    MetaDef = new SheetMetaDef { title="Sheet3" }

  });

Best regards
Lars-Göran Book

4 Replies
Not applicable

Re: Not able to create new sheet using Qliksense SDK

Hi,

I can see that you are creating the sheet without title and rank (position in the list). Try

Application.CreateSheet("Sheet3", new SheetProperties

  {

    Rank = 3,

    MetaDef = new SheetMetaDef { title="Sheet3" }

  });

Best regards
Lars-Göran Book

prabhuappu
Contributor II

Re: Not able to create new sheet using Qliksense SDK

Hi Lars,

Thanks a lot for the info. It is working now. Is there any document where we can find the mandatory properties for a object.

While creating a dimension also i'm facing the same issue. I think i'm missing to set some property. But i could't find that in Help Documentation.

Regards,

Prabhu Appu

Not applicable

Re: Not able to create new sheet using Qliksense SDK

Hi,

If you are refering to the library / master items you only need to set the field definition. Al though it is not mandatory it is a good practice to set the title. Here is an example for dimension and measure:

myApp.CreateDimension("Dim2", new DimensionProperties { Dim = new NxLibraryDimensionDef { FieldDefs = new[] { dim } }, Title = "Dimension1 "});

myApp.CreateMeasure("Count(Dim1)", new MeasureProperties { Measure = new NxLibraryMeasureDef { Def = measure }, Title = "Measure1" });

If you are refering to a dimension within an client object such as the bar chart you need to set the Cid, the same applies to measures.

Best regards

Lars-Göran Book

prabhuappu
Contributor II

Re: Not able to create new sheet using Qliksense SDK

Hi Lars-Göran,

Thanks again for the help. Now i can create dimensions.

Regards,

Prabhu Appu

Community Browser