Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Does anyone know if it's possible and how to run a distribution task from a batch file?
Bump it up...
Section 25.2 Reloading a file from the command line in the QlikView Server Reference Manual explains it fairly well.
Here's an example of the type of batch script that I use...
set AppProgram="C:\Program Files\QlikView\Publisher\Distribution Service\QlikviewDistributionService.exe"
set QvwName={Document Name}.qvw
set ProcessName={Document Name}
set QvwPath=C:\ProgramData\QlikTech\Publisher\Sourcedocuments\{Document Path}
%AppProgram% -out=%QvwPath%\%ProcessName%_reload_%date%.log -r=%QvwPath%\%QvwName%
IF %ERRORLEVEL% NEQ 0 goto Error
@echo Finished-%date% %time%
EXIT
:Error
blat -body "%date% %time%" -to "{address}" -server "smtp.company.com" -f "{From Address}" -subject "{ProcessName} - Reload Failed"
@echo Finished-%date% %time%
EXIT
The blat line allows me to receive email notification if the reload fails.
Good luck,
B
Thank you, but I need to distribute the file and not reload it. That's why I want to run a distribution task and not a reloading one.
You could configure a distribution task and trigger it using "on an external event". Then call the task from you batch program.
See section 27.5 Triggering EDX Enabled Tasks in the QlikView Server Reference Manual
Good luck,
B
The problem is that I am not very good in that kind of scripting and the manual does not show a real example...
Here's a good link for EDX help, including a script file that you can modify...
http://community.qlik.com/thread/15988
Hope this helps,
B
hi bnichol,
Could you please explain what do you mean by document name here is it filename.qvw or the task name? And the QVWpath is it the QEMC path or the path where qvw file physically exists? Plus, in the blat part below - address meaning our email address and from address meaning ?? Please explain in detail I am really confused about it. I am trying to use this code as a batch fiel to trigger my qvw task present in QEMC.
set AppProgram="C:\Program Files\QlikView\Publisher\Distribution Service\QlikviewDistributionService.exe"
set QvwName={Document Name}.qvw
set ProcessName={Document Name}
set QvwPath=C:\ProgramData\QlikTech\Publisher\Sourcedocuments\{Document Path}
%AppProgram% -out=%QvwPath%\%ProcessName%_reload_%date%.log -r=%QvwPath%\%QvwName%
IF %ERRORLEVEL% NEQ 0 goto Error
@echo Finished-%date% %time%
EXIT
:Error
blat -body "%date% %time%" -to "{address}" -server "smtp.company.com" -f "{From Address}" -subject "{ProcessName} - Reload Failed"
@echo Finished-%date% %time%
EXIT
Regards,
Avi
This script will reload a qvw file(document name), but it does not use the task identified in QEMC.
To call a Task identified in QEMC using EDX please refer to my previous postings in this thread.
The open source e-mail command line tool I'm using is called blat(http://www.blat.net/), but you can use any e-mail tool. To understand the command line format, please refer to documentation on the web site.
Good luck,
B