Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
rzenere_avvale
Partner - Specialist II
Partner - Specialist II

How can I alter field's selection from vb script?

Hi,

I'm pretty new to QlikView and I need a bit of help.

I need to print some reports with many different field's selections, so I was looking to dynamically modify the fields' value (maybe using a multidimensional array and looping on an index? I don't know yet) through VB script (I'll need to make this work from batch, so no buttons).

I'm currently stuck with the field selection. I know how to select it, but I don't know how to modify the value in the selection after I read it.

Is there anybody that can help me?

Edit: I found how to cycle on different fields, but then I discovered that I need not only to modify the selections, but also the "banding" of the single page of my report (which will be printed as a PDF) always from script. I took a look on the API (I'm working on QV 10 SR3), but the only thing I came up with is how to read the current banding value, not how to modify it. Any idea?

11 Replies
marcus_sommer

rzenere_avvale
Partner - Specialist II
Partner - Specialist II
Author

Hi Marcus,

thanks for your help. There I found how to cycle on the fields, but then I discovered that I need to modify also the banding of the current report (which will be a PDF, not an excel) from script. I took a look at the API (I'm working with QV 10 SR3) but I found only how to read the current value, not how to set a new one. Any idea?

gautik92
Specialist III
Specialist III

Have a look at this

Macros are Bad

rzenere_avvale
Partner - Specialist II
Partner - Specialist II
Author

Hi Gowtham,

I took a look at that document, I've really tried to avoid using macros. Unluckily I didn't come up with anything at all when trying. I'll accept really gladly any hint about how to modify the banding of a report and how to cycle on the possible values of a field without using macros (and triggers) as well

marcus_sommer

I'm not sure if I understand you right but assume you will need for different selections/objects different reports and/or types of exports. The easiest way for this is to create a (inline or excel) table which contained those depending values and which you put then in a tablebox through which your routine then looped - here is an example from a former posting: Re: Automation Macro what is meant and how could it be done.

- Marcus

jerrysvensson
Partner - Specialist II
Partner - Specialist II

Have a look at Introducing QlikView NPrinting | Qlik instead.

So much better for reporting.

rzenere_avvale
Partner - Specialist II
Partner - Specialist II
Author

Hi Marcus,

I think that in this situation the matrix wouldn't work. Let me explain better my current scenario.

Into my report I need to modify some selection and, based on those selection I need to modify the banding that is set into the report settings. So the point is that I don't need (always) to generate a single page for every selection... Which can be done (only?) through banding

rzenere_avvale
Partner - Specialist II
Partner - Specialist II
Author

Hi Jerry,

thank you for your hint! I already took a look at NPrinting, but unluckily I won't be able to use it on the production environment so I'm trying to find a good workaround to make good reports...

marcus_sommer

The more complex your requirements are the more sense make it to use table-structures which contained all needed informations and which could be looped through. If you are using more then one table or using from per any delimiter concatenated values you could create nested structures like a multi-dimension array. On one way or another you will need to tell the routine(s) what they should doing and such tables are an easy way to create and use such control-informations.

Another helpful point could be to use for this printing/exporting specialized applications and/or (various and multiple) specialized sheets and objects whichs might avoid complex nested requirements an/or overlappings with them.

Btw. what is the reason that you couldn't use NPrinting in your production-environment? I hope not the money then the needed time to reach the necessary knowledge and to implement and maintain a stable macro-solution could be cost more especially in the long-term. And for any other reasons might be other solutions possible, too.

- Marcus