Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

Highlighted
susovan_g
Valued Contributor

Declare Size of Image

I want to set height and width of image which fetch from database.

Is this possible in Qlikview Script?

3 Replies

Re: Declare Size of Image

You will need macros for this. Here an example from the APIGuide.qvw (is in your install-folder by automation) how you could set such properties:

rem double size of all sizable objects on active sheet

set sh = ActiveDocument.ActiveSheet

dim dummy(0)  'dummy array indicates all parts of frame to be set

for i = 0 to sh.NoOfSheetObjects-1

    set obj = sh.SheetObjects(i)

    set fr = obj.GetFrameDef

    set pos = fr.Rect

    pos.Width = pos.Width * 2

    pos.Height = pos.height * 2

    obj.SetFrame fr,true,dummy

next

- Marcus

susovan_g
Valued Contributor

Re: Declare Size of Image

Macro does not work in web portal.

Re: Declare Size of Image

That's right but there aren't other inbuilt features with them you could adjust these properties.

If you have only a few varieties you could create an single object for each and control then the visibility of them. But with many varities it's not very practicable. The only way then would be to use an extension for it. I think if you searched for extensions you will find any examples which have implemented a way to control the heights and widths and which you could then adapt for your solution.

- Marcus