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

Qlikview Extension Maximum Data Rows.

Hi,

I am trying to make an extension using QlikView SDK.I have been able to show the extension in QlikView Web view, but I am struggling with a problem.

Although all dimensions and expressions I have defined should send like 200 and more rows of data to the JavaScript this.Data.Rows object, it seems that only the top 40 rows of data transfers to this.Data.Rows.

How can I change the setting, if any, to be able to send more than 40 rows to JavaScript object.

Thank you for your help in advance.

8 Replies
Not applicable
Author

You have to define the PageHeight attribute of your ExtensionObject element in the definition.xml file, it defines the max number of data rows your extension will receive. For example:

<ExtensionObject Label="MyExtension" Description="extension with a lot of rows" PageHeight="10000" >

There is (was?) a way to do that programmatically, but given that the documentation does not really document anything in details I won't be able to help you with it.

Not applicable
Author

I had the same "problem", that only 40 rows where displayed.

In one example I found the programmatic way of doing it. You can either set the Pagesize for the X or the Y or for both axes.

Just put this in your script.js:

this.Data.SetPagesizeX( 200 );
this.Data.SetPagesizeY( 200 );
this.Data.SetPagesize({x: 200, y: 200});

In the JS API Documention these methods are listed under the class "QvaPublic.Data".

Not applicable
Author

Where is the correct place to call this.Data.SetPagesizeY(200) ? Calling it from the paint function of Qva.AddExtension() does not seem to initialize it correctly, seems to work the 2nd time called.

vegard_bakke
Partner - Creator III
Partner - Creator III

Setting the page size is not the correct way of solving this, as the extension cannot know how large the dataset is, before actually retrieving parts of it.

However, you should retrive the next page of data, by using Qv.Document.Object.Data.PageObject functionality either Next() or Set(pageNumber).

Haven't done this myself, so if anyone could post a short sample it would be great.  (I presume the initial poster has solved her issue, but others are still reading and searching the forum... : )

Cheers,

Vegard

bWise

Not applicable
Author

I've tried using the following solution to fix this issue in javascript for a particular list box (LB21), but it does not work. It try it and I get the "Updating data" dialog. I refresh the page and it fails to display rows > 40. I refresh the page a third time, and it works. Does anyone have suggestions on how to procede?

helmut_winkler, to answer your question, Qv.Document.Object.Data does not seem to be initialized fully until SetOnUpdateComplete is called on the object.

I'll try the Next() functionality that vegard.bakke suggests next.

settings.BodyOnLoadFunctionNames = ['initQlikView'];

Qv.InitWorkBench(settings);

function initQlikView() {

    Qv.GetCurrentDocument().GetAllObjects(function(objects) {

        for (var i = 0; i < objects.length; i++) {

            if (objects.type == 'List Box' && objects.id.match(/LB21/)) {

                var object = Qv.GetCurrentDocument().GetObject(objects.id);

                object.SetOnUpdateComplete(function() {

                    if (this.Data.SetPagesizeY && this.Data.TotalSize.y > 40)

                        this.Data.SetPagesizeY(this.Data.TotalSize.y);

                });

            }

        }

          });

}

Not applicable
Author

You can use PageHeight="200". If you put a space between PageHeight and '=' (PageHeight ="200"), it somehow ignores it.  If you don't include PageHeight, QlikView is sending 40 rows by default. 


You can find more about Definition.xml from following link. http://community.qlik.com/message/171123

Not applicable
Author

Try this to get all your rows in one Data object.

var maxRows = 5000; // or whatever you want.

Qva.AddExtension( "myExtObj", function() {

     var object = this;

     if (object.Data.PageSize.y != maxRows) {

           object.Data.SetPageSizeY( maxRows);

          var page = object.Data.Page;

          if (page == null) {

               // create a Page object which is basically an index (not data) holder

               object.Data.Page = new object.Data.PageObject( this.Data, maxRows, 1);

               object.Data.Page.Set(1); // trigger a refresh whereby Data.Rows will be maxRows

               return; // so refresh can happen

          }

    }

   // Process object.Data.Rows here...

},true);

If you want to obtain data in smaller chunks then create PageObject with the smaller chunk size and

call Page.Next(); after each processing of object.Data.Rows in order to trigger an update for the next chunk.

Not applicable
Author

Your solution worked with all my extensions.

Lately I've been seeing the error...

TypeError: Unable to get value of the property 'TotalSize': object is null or undefined

-- any ideas?