Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Textobject

Hi,

What is the command/syntax to input the data to textobject from vbscript. I want to print the values in the database table in to the text object.

Code is working fine using the msgbox. But not able to print in the text object.

9 Replies
Anonymous
Not applicable
Author

Use a variable in the text box, for example:
=vText
and, it is easy to assign a value to this variable in a macro.

Not applicable
Author

Thanks Michael,

I have tried it using the set content as well but not working. Also it is not one value the table has multiple values and it has to loop through. Any idea. Please suggest

Anonymous
Not applicable
Author

A simple solution is to concat all your possible field values, and use the result in variable.

sub GetDataToTextBox
ActiveDocument.Variables("vText").SetContent ActiveDocumentEvaluate("concat(distinct, FieldName, '; ')") , true
end sub

Not applicable
Author

Thanks Michael,

Please correct me if i am wrong. I feel the script will work only for the data already loaded in Qlikview. I am trying to establish the connection in macro and pull the data and try to put it in the textobject.hence it may not work . I am getting error while trying to run this script

llauses243
Creator III
Creator III

Hi,

Put point (pls see image attached)

Good luck, Luis.

llauses243
Creator III
Creator III

Also out comma ...

Anonymous
Not applicable
Author

That's correct, thanks.

And - yes, the data must be in QlikView for this to work.

Not applicable
Author

Thanks Michael for the logic ,

I have used the similar logic by concatenating the strings using vb script and resolved the issue.

Anonymous
Not applicable
Author

I used to do it in a loop in macro, but it was before the 'Evaluate" method was introduced. It helps to simplify a lot, not only in the cases like this.
More important - you've got it to work one way or another.