Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
is it possible to set object's properties in script. for example i want to set object's X and Y position which we define in Caption tab. i want to do that through scripting. is it possible.?? If yes then help me out..
regards
Afzal.
Afzal,
Yes, it is possible. See example with Left=0.
sub Move
set p1 = ActiveDocument.GetSheetObject("TX01")
set fr = p1.GetFrameDef
set pos = fr.Rect
pos.Left = 0
p1.SetFrame fr,true, ""
end sub
Hi Afzal,
As far as I know you can't set object positions straight from the script. However, you could run a macro when opening your QVW, which reads values from variables defined in your script and uses those to position objects.
Attached is a simple QVW which defines two variables x_pos and y_pos in the script, and a macro position_table which positions the tablebox to the location defined by x_pos and y_pos.
With regards,
Martijn ter Schegget
PS: to find out more about macro syntax, take a look at the 'Apiguide.qvw' in the Documentation subdirectory of your QlikView program directory.
Martijn
This is awesome! I am a designer not a programmer, and I really liked how well this works. Is there any way you could give me an example of how you could apply this to multiple objects? Not all objects on the sheet, just a certain set of objects.
Thanks,
Kris
thanks for this example you really saved my design!
Thanks
Mireille