<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Running QV Macro from QV Server? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Running-QV-Macro-from-QV-Server/m-p/293603#M108933</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem that require me to create a number of Chart expressions after the data load. &lt;/P&gt;&lt;P&gt;I've created a Macro that runs after the OnPostReload trigger, and it works fine if I do the reload from inside QV desktop.&lt;/P&gt;&lt;P&gt;When put into a task on QV server however it doesn't run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After googling I found a few threads here on the forum that clarifies that the OnPostReload trigger doesn't fire when run from the server, and that this is "by design".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain why this shouldn't work? It seems like a very useful feature to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Back to my problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I eventually found information that said I could instead create a .cmd file with a line to run qv.exe from the command line with specific parameters. I could then add this .cmd file to QV server as an "External program", and add it as a Task. I would also have to change the macro to run from the "OnOpen" trigger instead, which I did.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have a .cmd file that works as expected when I run it from a command window. It opens qlikview, runs the macro which creates the expressions and then save the resulting QV document to the "Documents" folder on the QV server.&lt;/P&gt;&lt;P&gt;If I run it as a task from within QV enterprise manager however it appears to start (I can see a qv.exe process is started in task manager), but it never finishes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an idea what can be wrong?&lt;/P&gt;&lt;P&gt;Can it be a license problem? In task manager QV runs under the administrator account.&amp;nbsp; When I added the license to QV desktop it asks for a Windows User, and I wrote "Administrator" in the field. I this correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any input.&lt;/P&gt;&lt;P&gt;/Joakim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jan 2012 13:02:31 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-01-20T13:02:31Z</dc:date>
    <item>
      <title>Running QV Macro from QV Server?</title>
      <link>https://community.qlik.com/t5/QlikView/Running-QV-Macro-from-QV-Server/m-p/293603#M108933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem that require me to create a number of Chart expressions after the data load. &lt;/P&gt;&lt;P&gt;I've created a Macro that runs after the OnPostReload trigger, and it works fine if I do the reload from inside QV desktop.&lt;/P&gt;&lt;P&gt;When put into a task on QV server however it doesn't run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After googling I found a few threads here on the forum that clarifies that the OnPostReload trigger doesn't fire when run from the server, and that this is "by design".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain why this shouldn't work? It seems like a very useful feature to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Back to my problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I eventually found information that said I could instead create a .cmd file with a line to run qv.exe from the command line with specific parameters. I could then add this .cmd file to QV server as an "External program", and add it as a Task. I would also have to change the macro to run from the "OnOpen" trigger instead, which I did.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have a .cmd file that works as expected when I run it from a command window. It opens qlikview, runs the macro which creates the expressions and then save the resulting QV document to the "Documents" folder on the QV server.&lt;/P&gt;&lt;P&gt;If I run it as a task from within QV enterprise manager however it appears to start (I can see a qv.exe process is started in task manager), but it never finishes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an idea what can be wrong?&lt;/P&gt;&lt;P&gt;Can it be a license problem? In task manager QV runs under the administrator account.&amp;nbsp; When I added the license to QV desktop it asks for a Windows User, and I wrote "Administrator" in the field. I this correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any input.&lt;/P&gt;&lt;P&gt;/Joakim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2012 13:02:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-QV-Macro-from-QV-Server/m-p/293603#M108933</guid>
      <dc:creator />
      <dc:date>2012-01-20T13:02:31Z</dc:date>
    </item>
  </channel>
</rss>

