Discussion Board for collaboration on QlikView Scripting.
As a part of automating some QA processes I want to export some objects (their data of course) from my UI to csv files while the loading script executes. is that possible?
Also, is it possible when doing the reload phase, to use the macros to generate several selections on some filters and then make the export above?
Go to Solution.
Try this macro
myCharts(0) = "Coat"
myCharts(1) = "Suit"
myCharts(2) = "Boxes"
For Each item In myCharts
SET objChart = ActiveDocument.GetSheetObject(item)
objChart.Export "C:\" & item & ".CSV", ", "
Verify STORE command on first point. Edit Script is synchronous process not asynchronous.
One Second point inside I don't understand what is the real question.
No, it is not possible to access any UI objects during the load script. The ActiveDocument object, which is required to access any sheet objects, does not exist during the load.
It is not possible to process the UI objects during script reload, what you can do is trigger the macros on post reload of the document.
You can trigger this by
Settings -> Document Properties -> Triggers -> Document Event Triggers -> On PostReload
Hope this helps you.
Thanks for the info.
Is it possible to export objects to csv and not xls?
SET objChart = ActiveDocument.GetSheetObject("CH01")
objChart.Export "C:\Data.CSV", ", "
This saves the csv file in C drive. Replace CH01 with your chart ID.
and do you think there is a way to create a loop to export all charts in the UI automatically?
a sub that will set the file name as the chart ID.
That means I need first to put all of my chart names into this array?
You can export a table to csv in the load script without a macro simply by using a store command with the (txt) qualifier.
store tablename into filename.csv (txt) ;