Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
i'm trying to make file save with variable name - date and field name.
i have succeeded to get date into file name .
tabe "Daily_days" has selection 20, and msgbox for double check returns value 20.
but i lack of knowlegge how to input this into file name
so now i get 2016222-20.pdf the date today 2016.02.22 and manually 20 ...
how to express in the code var_name = value from Daily_days table selected ? (it's always 1 number selected in that table)
SUB save
SET id= ActiveDocument.Fields("Daily_days")
SET selection = id.GetSelectedValues
msgbox(selection(i).Text) 'returns now value 20, because day 20 is selected
vReport="RP03"
vX= Year(now())& month(now())& day(now())
var_name="-20"
printReportPDF "D:\Autoreports\QV_Daily_Sales_SQL\" & vX & var_name & ".pdf"
ActiveDocument.GetApplication.Sleep 2000
ActiveDocument.PrintReport (vReport), "QlikViewPDF"
ActiveDocument.GetApplication.Sleep 10000
END SUB
thank you !
set var_name = selection(i).GetContent.String
-Sathish
thanks, but it does not work, it stops in the middle
SUB save
SET id= ActiveDocument.Fields("Daily_days")
SET selection = id.GetSelectedValues
msgbox(selection(i).Text) 'returns now value 20, because day 20 is selected
vReport="RP03"
vX= Year(now())& month(now())& day(now())
set var_name = selection(i).GetContent.string
printReportPDF "D:\Autoreports\QV_Daily_Sales_SQL\" & vX & var_name & ".pdf"
ActiveDocument.GetApplication.Sleep 2000
ActiveDocument.PrintReport (vReport), "QlikViewPDF"
ActiveDocument.GetApplication.Sleep 10000
END SUB
what is the error message?
Post your application. its very easy
-Sathish
set var_name = selection(i).GetContent.string
That should not have a set statement, the RHS expression does not return an object. So use
var_name = selection(i).GetContent.string
the correct code is
var_name = (selection(i).Text)
then it works.