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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
NareshGuntur
Partner - Specialist
Partner - Specialist

QlikView Macro for TableBox

Hi Guys,

I am trying to create a table box automatically using a macro.

I have a list of fields already and I want to add these fields to the table box through a macro. As suggested in the API guide, it is not possible to manually add all the fields using addfield "Class" etc. Please suggest me a way for this.

Cheers,

Naresh

1 Solution

Accepted Solutions
NareshGuntur
Partner - Specialist
Partner - Specialist
Author

Got this and it works fine

set mybox = ActiveDocument.GetSheetObject("M001")

MB = mybox.GetProperties

MB.Layout.Frame.Name.v=ActiveDocument.Variables("Variable1").GetContent.String

mybox.SetProperties MB

set MB = ActiveDocument.GetSheetObject("MB001")

For i = 0 to MB.GetRowcount - 1

  MB.RemoveField 0

next

For i = 0 to GeoLabel.count - 1

  MB.AddField GeoSelection.Item(i).text

  mbp = MB.GetProperties

  mbp.MemberAttributes.Item(i).Label.v = FieldLabel.item(i).text

  MB.SetProperties mbp

Next

View solution in original post

1 Reply
NareshGuntur
Partner - Specialist
Partner - Specialist
Author

Got this and it works fine

set mybox = ActiveDocument.GetSheetObject("M001")

MB = mybox.GetProperties

MB.Layout.Frame.Name.v=ActiveDocument.Variables("Variable1").GetContent.String

mybox.SetProperties MB

set MB = ActiveDocument.GetSheetObject("MB001")

For i = 0 to MB.GetRowcount - 1

  MB.RemoveField 0

next

For i = 0 to GeoLabel.count - 1

  MB.AddField GeoSelection.Item(i).text

  mbp = MB.GetProperties

  mbp.MemberAttributes.Item(i).Label.v = FieldLabel.item(i).text

  MB.SetProperties mbp

Next