Skip to main content Skip to complementary content

Using InitialSearch

This example loads two objects from a single QlikView document. An initial search will be made on the Forecast Category list box, using the search expression *an* where * is used as a wild card.

Example

Example with list box and chart objects imported from a single document, with initial search expression highlighting already in place

Reference to QlikView JavaScript file

<script language="javascript" type="text/javascript" src="http://SERVER_URL/QVAJAXZfc/htc/QvAjax.js"></script> 

Source code (HTML header)

JavaScript code placed in the header of the HTML file to initialize the QlikView objects.

<script language="javascript" type="text/javascript">
   Qv.InitWorkBench({
      View: 'Sales Compass',
      BodyOnLoadFunctionNames: [function() {
          $(window).on('resize', function() {
          $("[qvobject]").trigger('qvresize');
          });
      }],
      Host: null,
      InitialSearch: ["LB221,*an*"]
   });
</script>
Information note Set the Host property to null or omit it if you want to use the default QlikView server connection for the web server, defined by DefaultQvs in the web server configuration file (C:\ProgramData\QlikTech\WebServer\config.xml). The Host property must be defined if several QlikView server connections exist for the web server.

Source code (CSS definition)

<style>
.qvcontainer {
    display: flex;
    flex-direction: column;
    height:50vh;
    margin:0px;
}
.qvitem {
    flex-grow: 1;
    margin:20px;
}
</style>

Div integration

DIV blocks to place the QlikView objects within your web page.

<body class="qvcontainer">                
    <!-- Chart with the ID CH137 -->
    <div class="qvitem" qvobject="CH137"></div>
    <!-- Listbox with the ID LB221 -->
    <div class="qvitem" qvobject="LB221"></div>
</body>

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!

Join the Analytics Modernization Program

Remove banner from view

Modernize without compromising your valuable QlikView apps with the Analytics Modernization Program. Click here for more information or reach out: ampquestions@qlik.com