Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Export Table to XML by Script or Macro

Hello everybody,

I work for a year with QlikView and got today a task I can not solve seemingly without your help.

I need to export a table to XML format. To do this, I wrote a macro, which exported the table.

The macro is started automatically when the script is run. Trigger in the document properties.

However, the macro will not run if the document is updated by the Server service. I open the document and start the script by hand, then it works.

Is there a solution for this?

I am grateful for each approach.

Using QV 11.20 SR2

Regards

Marcel

Tags (4)
1 Solution

Accepted Solutions

Re: Export Table to XML by Script or Macro

Yes macros on server are difficult to don't work. Check the settings in QEMC under System/Setup/QVS-Server/Security/Miscellaneous. If this not work you could use a cmd-file like this:

"D:\YourPathToExe\QV.exe" /r "D:\YourApp.qvw"

- Marcus

4 Replies

Re: Export Table to XML by Script or Macro

See in APIGuide.qvw for examples like this:

rem create new straight table and export in xml

set chart = ActiveDocument.Sheets("Main").CreateStraightTable

chart.AddDimension "ProductType"

chart.AddExpression "sum(Amount)"

chart.ExportXml "C:\test.xml"

- Marcus

Not applicable

Re: Export Table to XML by Script or Macro

Yes, I do so, it ist working, but the Macro wouldn´t start, if you won´t open the document and reload the script manually (I prepared the doc, that the macro runs, when the Script ist reloaded).


But I don´t want to reload manually. I configure the automatic reload in the QlikView management console. And if the reload runs there, the script did not start.

Also noch kurz auf deutsch:
Das Makro läuft und exportiert die Tabelle. Eingestellt habe ich es so, dass der Reload des Skripts als Auslöser für den Makroaufruf verwendet wird.
Da funktioniert aber nur, wenn man das Skript manuell und in der Anwendung ausführt. Dann wird auch das Makro gestertet.
In der QV-Management-Console bei automatischem Reload, wird das Makro  nicht ausgeführt ... :-( Aber genau da muss es laufen, weil ich ja nicht jedes mal die Anwendung öffnen will.

Marcel

Re: Export Table to XML by Script or Macro

Yes macros on server are difficult to don't work. Check the settings in QEMC under System/Setup/QVS-Server/Security/Miscellaneous. If this not work you could use a cmd-file like this:

"D:\YourPathToExe\QV.exe" /r "D:\YourApp.qvw"

- Marcus

Not applicable

Re: Export Table to XML by Script or Macro

Yes, cmd-file works!
Thanks a lot

Marcel

Community Browser