Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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

1 Solution

Accepted Solutions
marcus_sommer

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

View solution in original post

5 Replies
marcus_sommer

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
Author

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

marcus_sommer

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
Author

Yes, cmd-file works!
Thanks a lot

Marcel

SohaibAkhtar
Contributor
Contributor

Hi,


I was facing the same problem. Can you help me with the macro u wrote to export the report to XML format. Would really appreciate your help here