Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
shantanu73
Creator II
Creator II

help require where with the help scripting/macro where we can change the font, colour, width, etc of any object(text, chart, etc)

Hello Friends/Guru's/Master,

I want to change the color, font, background color, width, height, etc of any object (text object, chat object, etc) by scripting/macro.

It will be great help if anybody show the way out to achive my requirement by providing me small QVW file example.

Thanks in Advance

Shantanu

7 Replies
shantanu73
Creator II
Creator II
Author

Dear All,

Awaiting for response

Thanks

Shantanu

Not applicable

pLs refer attachment..

~kabilan k

shantanu73
Creator II
Creator II
Author

Hello Kabilan,

First let me tell you Lot of thanks for quick response. The code which U had given I had implemented. And working fine.

But I am trying to understand the 3rd line i.e. "set pos = fr.Rect" and 6th line i.e. "obj.SetFrame fr,true,dummy" . If If u don't mind can u please explain it.

Suppose, If we want to change the Caption/Header Background Color,  Font, Etc of Chart Object what can be the script.  Since I am in middle of develop I can not move further. It will be great help if u can guide me.

Thanks in Advance

Shantanu

shantanu73
Creator II
Creator II
Author

Hello Kabilan/Friends

Awaiting for Solution/Response.

Thanks

Shantanu

Not applicable

Hi,

"set pos = fr.Rect "= http://support.smartbear.com/viewarticle/30373/

Setframe is a API method, it is used to change the border of the any sheet objest

SetFrame(Frame,Rects,parts)

Frame=fr=Sheet object frame

Rects= True if position/size rectangles to be included

parts=

Parts Variant (Array of short) in Parts of frame to be set.

Should either be empty (all parts set)

or contain an array containing one element for

each part of the frame to be set. The element

should contain one of the numbers below:

0    BORDER_CHANGE,

1    CAPTION_ON_OFF,

2    LAYER_CHANGE,

3    ALLOWMINIM_CHANGE,

4    ALLOWMAXIM_CHANGE,

5    ALLOWINFO_CHANGE,

6    AUTOMIN_CHANGE,

7    ALLOWMOVESIZE_CHANGE,

8    CONDSHOW_CHANGE,

9    FONT_CHANGE,

10  ADVANCEDCAPTION_CHANGE,

11  MACRO_TRIGGER_CHANGE,

The order of the elements is arbitrary.

I hope, It helps u

~Kabilan K

shantanu73
Creator II
Creator II
Author

Hello Kabilan/Friends,

I had tried my level best but could not make out.

It will great help if, I can get exact solution with example for changing the colour for Chart Caption on clicking in some other object for eg in Button object. On click the button object the chart Caption Color should get change as per the colour mention in macro written in button object.

Thanks in Advance

Shantanu

qlikhalmar
Creator
Creator

Hi kabilan,

Thanks for your macro.

I want to use it to automatic resize a table in combination with ActiveDocument.GetApplication.ScreenWidth.

But it is not working when i do something like:

sub ChangeWidthHeight


'Settings

       set obj              = ActiveDocument.GetSheetObject("TB01")


'Set object width and height

    set fr                                             = obj.GetFrameDef

    set pos                                     = fr.Rect

    pos.Width                                          = ActiveDocument.GetApplication.ScreenWidth - 280

    pos.Height                                         = ActiveDocument.GetApplication.ScreenHeight - 134

    obj.SetFrame fr,true,""

   

end sub

Perhaps you have a solution for this one?

Thank, Halmar