Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My end goal is to write a text file in a certain format upon reload of a QVW. The text file must use data gathered upon the reload in this text write out.
As a simplified example, I'd like a text file that says:
Hello World.
Field: Field1Name, Row: 1, Value=5 [that 5 was gathered upon reload]
Goodbye World.
I have been looking through the help and the forums and see no way to directly write to a text file from the script. I understand that you can use a store command and store a table in a text file, but that is not what I'm looking for. As step 1, I was wondering if anyone knows how to just write "Hello World" to a text file within the Qlikview script?
I saw that many people are using an Upon Post-Reload macro to write specific info to text files. Is that the only way? That would make my task more difficult because then I would have to get information from one of my tables in the data model loaded into my macro so that I could use it to help write my text file.
Any thoughts are appreciated! Thanks.
I use the following to do what you're requesting:
Conf:
Load 'Reload Completed: '&now() as Confirmation
AutoGenerate 1;
STORE Conf Into \\usavm090\Logs\QV_Triggers\CONV_Conf.txt (txt);
Drop Table Conf;
Of course you can add expressions etc into the table to give more information, in my case the text file is created so a monitoring tool can spot the files creation and trigger a further event.
Hope that helps,
Matt - Visual Analytics Ltd
I use the following to do what you're requesting:
Conf:
Load 'Reload Completed: '&now() as Confirmation
AutoGenerate 1;
STORE Conf Into \\usavm090\Logs\QV_Triggers\CONV_Conf.txt (txt);
Drop Table Conf;
Of course you can add expressions etc into the table to give more information, in my case the text file is created so a monitoring tool can spot the files creation and trigger a further event.
Hope that helps,
Matt - Visual Analytics Ltd
Your answer fixed my problem. Turns out in my testing I did not add the (txt) at the end of the store statement which was putting myoutput in xml format. This will get me going. Thanks!
Thanks Mathew thsi tip helped me out
hi
is any way to do this using a macro. i donot want to reload my app
tnx
Hi,
With normal API's its not possible as per my knowledge, but document can be reload using below code
Sub Reload
ActiveDocument.Reload
ActiveDocument.Save
End Sub
Excellent!!!