Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
linoyel
Specialist
Specialist

Run cmd file in Windows task scheduler in Qlikview server

Hi,

I have a c# code that opens a qvw document and sends mail based on the document data.

I need it to be sent once a day, so I wrote a cmd file that works perfectly if I press on it.

The problem starts when I'm putting it in Windows task scheduler - it's not doing anything, and it seems to me it's getting stuck while trying opening Qlikview.

What am I doing wrong?

Is there another way of scheduling the execution of a batch file in BI server?

Thanks.

23 Replies
linoyel
Specialist
Specialist
Author

Hi Jerry,

My account has Administrator privileges on QV server. Isn't that the highest one?

As I wrote above, the task runs when the option "Run only when user is logged on" is ticked,

but id doesn't work when "Run whether user is logged on or not" is ticked... and that's the option I need, obviously...

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Linoy,

it is possible to open a QVW document from a Windows Scheduler Task. The problem is a tricky one, and various discussions on the community point in this direction: QlikView Desktop needs an UI and that is incompatible with batch execution (e.g. execution in the background without UI)

Your experiment with selecting option "Run only when user is logged on" clearly points in the same direction. Being logged on means that a "terminal" is available, even though QlikView doesn't need it in order to just execute some macros or access a bit of data.

Note that reloading a document will probably work OK without User Interface. I suspect this is because QlikView disables interactive mode when reloading / executing the load script via the command line.

linoyel
Specialist
Specialist
Author

Yeah, I saw a few discussions on the same topic here in the community but the only answer I see here is the same you're telling - that QlikView Desktop needs an UI.

In which QV settings it says that QV desktop can work in interactive mode only? Maybe it's possible to switch it off somehow?

I wonder, what if I use QV Access Point, and not QV desktop?

Does AP obligate interactive mode as well?


Peter_Cammaert
Partner - Champion III
Partner - Champion III

You mean to use the services of a QlikView Server to send email? That's possible as well, but I think you won't be able to use your current custom application for that. Some reasons:

  • The AccessPoint is nothing but UI and macro features are severely limited. It could work if you write a macro to send email, and then open the document in the IE plugin (won't work in AJAX mode). But this is a manual-only process. And you want to do away with the UI...Doh
  • The Distribution service is the only one performing a QVW task without UI. It's a pity it will only run the reload script and nothing else
  • You can schedule a Supporting task (if you have a Publisher) to run your C#-code but then you're stuck with the same problem as before: running a headless QlikView Desktop

IMHO If you want the QlikView Server to send emails based on QlikView data, you'll probably have to change your approach in a major way. The community contains a few tips and tricks to make this work.

(BTW a Publisher supports sending emails after each succesful reload where the message contains a link to the published document with the new data. Something to contemplate?)

jerrysvensson
Partner - Specialist II
Partner - Specialist II

Yes and no. 🙂

Does your user has the Log on as a batch and Log on as a service privileges for instance?

As I wrote earlier, we have this working on one machine, but not on another.

linoyel
Specialist
Specialist
Author

So, if the AccessPoint is nothing but UI, it won't help me...

And I don't have a Publisher 😕

At first (before C# code) I tried to write a macro in the QV module but the problem was that it didn't work with an OnPostReload trigger. It worked with an OnOpen trigger or if I attached macro to a button but it didn't serve my needs cause both of them are manual and I need the e-mail to be sent once a day at the same hour automatically.

I guess I'll:

1. Check in the Community how QlikView Server can send emails based on QlikView data. Not sure though how, cause the only thing I have on the server is QMC that only reloads docs on schedule...

2. Check thoroughly my user privileges (if it has the Log on as a batch and Log on as a service privileges), as Jerry suggested.

3. Check an option to have a certain user to be always logged on.



linoyel
Specialist
Specialist
Author

Jerry, can you please tell me exactly which privileges I have to grant to my user so the task will run in a "whether user is logged in or not" mode?

jerrysvensson
Partner - Specialist II
Partner - Specialist II

Unfortunately I can't tell you. Our IT fixed this. Could have been the two Local policies above, but I am not sure.

Add them, make sure you logoff and on after the change has been made.

luciancotea
Specialist
Specialist

Hi Linoy,

I struggled with the problem, seems that task scheduler has it's own problems.

My solution was to use another scheduler (JIT from GibinSoft). You also need to run it under an account with proper privileges.

Lucian

vikasmahajan

PFA Documents .

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.