Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
gokulraj
Contributor
Contributor

Auto Export of Chart using Macro is not working in Server

Hi Team,

We have a requirement auto export the chart into excel,text,qvd in a particular path.So we given macro condition in Post refresh option found in Document Setting trigger.The macro which i am using is working in local desktop whereas it is not working in UAT server.

Below i attached the macro which i was used.

Macro 1 used to export the chart into txt:

sub ExportExcel
Dim DateTimeNow, DateTimeFormatted
DateTimeNow = Now()
DateTimeFormatted = DatePart("YYYY",DateTimeNow) &"_"& right("0" & "_"& DatePart("M",DateTimeNow),2) & "_"& right("0" & DatePart("D",DateTimeNow),2)

SET varVersion = ActiveDocument.Variables("vExportVersion")
SET varEntity = ActiveDocument.Variables("vEntity")

output= "Our Share path"
vFilename= varEntity.GetContent.String &"_"& DateTimeFormatted &"_"& "V" & right("0"&varVersion.GetContent.String,2) & ".txt"
set obj = ActiveDocument.GetSheetObject("CH01")
obj.Export (output& vFilename) , "|"
end sub

Macro 2: used to export chart into QVD

sub Exportqvd

Dim DateTimeNow, DateTimeFormatted
DateTimeNow = Now()
DateTimeFormatted = DatePart("YYYY",DateTimeNow) &"_"& right("0" & "_"& DatePart("M",DateTimeNow),2) & "_"& right("0" & DatePart("D",DateTimeNow),2)
SET v = ActiveDocument.Variables("vPath")

SET varVersion = ActiveDocument.Variables("vExportVersion")
SET varEntity = ActiveDocument.Variables("vEntity")
set obj = ActiveDocument.GetSheetObject("CH01")
vPathName= v.GetContent.String&"\"&varEntity.GetContent.String &"_"& DateTimeFormatted &"_"& "V" & right("0"&varVersion.GetContent.String,2) & ".qvd"
obj.ExportEx vPathName,4
end sub

Note:  

1. We enabled " Give system access  to Module Script" in Change Module Security.

2. Click on Button to export the macro is working in Server  (our Condition Auto Export)

None of the above are not working in server but working in local.

Please help me to get resolve from here.

Labels (1)
  • Macro

1 Reply
dplr-rn
Partner - Master III
Partner - Master III

Post refresh trigger on macros doesnt work on Server/QMC reloads.
One not Qlik recommended way of doing it is to use a bat file which will open the file on QV desktop on server and run it
Other alternative is nprinting