See I will explain u d functionality i need to achieve.
Basically after the qvw file gets reloaded, its PDF is to be created automatically for which i have written macro. I have set the action Run Macro on trigger OnPostReload and this works fine when I run the report on qlikview developer.
But when the same report is reloaded through qlikview server it does not fire the trigger after completion of reload.
I have also done the settings on server to allow macro execution. On qlikview community i found one more setting by pressing Ctrl+shift+m. I have also done that.
In spite of all these things macro is not getting executed on server. So i was trying if macros can be executed through edit script. I am using Qlikview 11.00 SR1 version and I dont have publisher.
Let me know if I have to do any other settings or anything else is required.
Please help on this matter ASAP. Its really very urgent.
You can execute macro functions by doing something like this in your load script: LET Execute = MyMacroSub();
Where MyMacroSub is a function defined in your macro.
The hard part is that the macro will execute with the security of the user that runs your QVService, or Publisher if you had that. So this is a HUGE security risk as you would need to assign system access to the account running your services.
The code seems to be OK, but ActiveDocument is not available when called from the load script, since the document only "exists" when the script has completely finished. So any call to ActiveDocument functions will not work (is not a bug but a design) if they are called from the script. Rather, you need to end the script then use a button or something similar to call them.
As a workaround, you can use the qv.exe /r parameter and create a batch file that is triggered from the Windows Scheduler instead of the QlikView Server, and has an action OnOpen or OnPostReload that calls the macro instead.