Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

coloum width minimization

hi

give the macro code please

how to increase the table coloum width in tabular chart conditionally [i.e when i click the button the table coloum width need to increase]

1 Solution

Accepted Solutions
fernandotoledo
Partner - Specialist
Partner - Specialist

Have you tried APIGUIDE.qvw in your QlikView instalation Directory?

I got this example there:


sub WIDTH_TEST
dim w(3)
w(1)=100
w(2)=150
set tb = ActiveDocument.Sheets("Principal").CreateTableBox
tb.AddField "Class"
tb.AddField "Member"
tb.AddField "MemberComment"
tb.SetPixWidths 0,w
end sub


best regards,

Fernando D'Agosto

View solution in original post

8 Replies
fernandotoledo
Partner - Specialist
Partner - Specialist

Have you tried APIGUIDE.qvw in your QlikView instalation Directory?

I got this example there:


sub WIDTH_TEST
dim w(3)
w(1)=100
w(2)=150
set tb = ActiveDocument.Sheets("Principal").CreateTableBox
tb.AddField "Class"
tb.AddField "Member"
tb.AddField "MemberComment"
tb.SetPixWidths 0,w
end sub


best regards,

Fernando D'Agosto

Not applicable
Author

Hi fernando ,

i have all ready created the table box with the created the table object TB01. how to increase the coloum widths by clicking the buttons. can you give macro for this tabular object i am new to qlik view

Not applicable
Author

hi sgoradia,

you can modify fernando's code a bit to suit your requirement

sub xyz

dim tbl

set tbl = Application.ActiveDocument.GetSheetObject("TB01")

dim w(3)

w(1)=100

w(2)=150

tbl.SetPixWidths 0,w

tbl.SetPixWidths 1,w

end sub



thanks

Not applicable
Author

HI Tauqueer

thanks for your code

i modified the code but i am getting one problem i have seven coloum the last coloum width is not changing can you please advise how can i do this.

fernandotoledo
Partner - Specialist
Partner - Specialist

Hi,

The function

tbl.SetPixWidths A,B

has two parameters:

A: First column number (0 based) to be formatted

B: Width in pixels for each column

I think the problem with the last column is happening because it starts counting on 0!

Hope it helps!

Fernando Yes

Not applicable
Author

hi fernado

thanks for you code

but i am getting a problem like when i given the coloum no is 6 it increase the width of the first coloum and the coloum no 0 all so increasing the width of first coloum

can you advise me please on this regards

thanks in advance

amars
Specialist
Specialist

Not applicable
Author

sub WIDTH_TEST3


set table = ActiveDocument.getSheetObject("TB03")


dim w(7)
w(1)=-100
w(2)=-100
W(3)=200
W(4)=-100
W(5)=-100
W(6)=-100
W(7)=-100



table.SetPixWidths 0,w
end sub