1 Reply Latest reply: Dec 17, 2014 4:29 PM by Brian Garland RSS

    Help with Custom Extension

    Brian Garland

      I played a bit with creating this document extension but haven't had a lot of success. This extension is specific to just one application so it doesn't matter if I hard-code in object and variable names. Here's an example:

       

      • QVW has 10 straight table charts.
      • I have created ten variables that are to contain the row count of each table, given any data selections.
      • The document extension keeps these ten variables updated with the current row count of each respective chart.

       

      So the extension simply needs to inspect each chart, get the current row count, set the corresponding variable to that row count. Should be easy but I don't know how to do it.

        • Re: Help with Custom Extension
          Brian Garland

          So this seems to work. If anyone can help optimize this, probably by using a loop, I'd appreciate it.

           

            var vDoc = Qv.GetCurrentDocument();

            var vCHTest1 = vDoc.GetObject("CHTest1");

            var vCHTest2 = vDoc.GetObject("CHTest2");

            var vCHTest3 = vDoc.GetObject("CHTest3");

           

            vCHTest1.SetOnUpdateComplete(function() {

            vRows = this.Data.TotalSize.y;

            vDoc.SetVariable("vCHTest1RowCount",vRows);

            });

            vCHTest2.SetOnUpdateComplete(function() {

            vRows = this.Data.TotalSize.y;

            vDoc.SetVariable("vCHTest2RowCount",vRows);

            });

            vCHTest3.SetOnUpdateComplete(function() {

            vRows = this.Data.TotalSize.y;

            vDoc.SetVariable("vCHTest3RowCount",vRows);

            });