Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to create sheet in Qlik Sense from Dot net

I try to create new sheets , objects in Qlik Sense  from Dot net and get this error "The function evaluation requires all threads to run."

Any idea for this problem

The function evaluation requires all threads to run.

Coding:

ILocation location = Qlik.Engine.Location.Local;

        protected void Page_Load(object sender, EventArgs e)

        {

            IAppIdentifier appIdentifier = location.AppWithName("KhanhDemo");

            IApp application = location.App(appIdentifier);

           // ISession appSession = Qlik.Engine.Session.WithApp(appIdentifier);

                try

                {

                   

                    ISheet mySheet = application.CreateSheet("TestCreateSheet");

                    txtText.Text += mySheet.Info.Type;

                }

                catch (Exception ex)

                {

                    txtText.Text += ex.Message;

                }

            }

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

You are getting this exception during debug and that is because the .Net SDK is "lazy", it only fetch the data when you access it. One way is to save the data that you want to inspect in a temporary variables. Further you need to set the title on the sheet and save it to make it work on the client.

ISheet mySheet = application.CreateSheet("Sheet2",

     new SheetProperties { Rank = 0, MetaDef = new SheetMetaDataDef { Title="My sheet" } });

applcation.DoSave();

Note thet your application must also have a script otherwise the client will ask you to add this before being able to work with sheets.

Here is some simple code to create a script:

application.SetScript("Load RecNo() as Dim1 AutoGenerate 100;");

application.DoReload();

Best Regards

Lars-Göran Book

View solution in original post

1 Reply
Not applicable
Author

Hi,

You are getting this exception during debug and that is because the .Net SDK is "lazy", it only fetch the data when you access it. One way is to save the data that you want to inspect in a temporary variables. Further you need to set the title on the sheet and save it to make it work on the client.

ISheet mySheet = application.CreateSheet("Sheet2",

     new SheetProperties { Rank = 0, MetaDef = new SheetMetaDataDef { Title="My sheet" } });

applcation.DoSave();

Note thet your application must also have a script otherwise the client will ask you to add this before being able to work with sheets.

Here is some simple code to create a script:

application.SetScript("Load RecNo() as Dim1 AutoGenerate 100;");

application.DoReload();

Best Regards

Lars-Göran Book