Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I have a document that is binary-reading from another document
What I want is also all the variables of the first document be available to the second document
is this possible?
Please advise
and here it is
Please mark as correct answer!!!
Note: Daily_Sales below is the target or the new document to copy variables to
sub CopyVariables
set vars = ActiveDocument.GetVariableDescriptions
set App = ActiveDocument.GetApplication
set UserFile = App.OpenDoc("Daily_Sales.qvw","","")
for i = 0 to vars.Count - 1
set v = vars.Item(i)
set variable = ActiveDocument.Variables(v.Name)
UserFile.CreateVariable v.Name
set v = UserFile.Variables(v.Name)
v.SetContent Variable.GetContent. String,true
ActiveDocument.ClearAll false
next
end sub
Message was edited by: ali_hijazi
Hi,
This is good thing to learn. But I know how to pass parameters from one qvw file to another using macro code in first qvw file. You can get more details in this link
http://community.qlik.com/message/270203#270203
Hope it helps you
Cheers!!
Jagan
Hello,
Please find the two files. Open the file community_25.qvw and click on navigate button. It will navigate to Community_26.qvw file along with variable Var_A_01 content to seond qvw file. You can test it, Click on Navigate button and open variables tab in document properties and see the value of Var_A_01 in second file. Make sure both files should locate at same path.
Hope it helps you
Cheers!!
Jagan
Now I understood the code
what I actually need is copy all available variables from one document to another
I'll try to upgrade the code so that it loops through all variables of one document and saves them to the other one
and here it is
Please mark as correct answer!!!
Note: Daily_Sales below is the target or the new document to copy variables to
sub CopyVariables
set vars = ActiveDocument.GetVariableDescriptions
set App = ActiveDocument.GetApplication
set UserFile = App.OpenDoc("Daily_Sales.qvw","","")
for i = 0 to vars.Count - 1
set v = vars.Item(i)
set variable = ActiveDocument.Variables(v.Name)
UserFile.CreateVariable v.Name
set v = UserFile.Variables(v.Name)
v.SetContent Variable.GetContent. String,true
ActiveDocument.ClearAll false
next
end sub
Message was edited by: ali_hijazi
Is there any way to pass variable value without using macro.
Regards
Sagar Gupta
This macro doesn't work with AJAX !!!
an idea to fix it ??
regard
Hi
It is helpful for me.
But I m not getting the how the variables are passed.
Actually i want to open different document with sheet number passed from one parent document