Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I export a table in Qlik view to excel sheet during reload.?
The following code creates the Excel sheet in correct format.
sub Export
set obj1 = ActiveDocument.GetSheetObject("TB01")
obj1.ExportBiff "C:\Documents and Settings\596732\Desktop\manasvi\InnerJoin.xls"
msgbox("Done")
end sub
u can use a macro and call the macro in the script and execute it but may be i am not sure .
If possible can you give the code for the same?
Write the below macro(Ctrl+M)
-------------
sub Export
set obj1 = ActiveDocument.GetSheetObject("TB01")
obj1.Export "D:\InnerJoin.xls",4
msgbox("Done")
end sub
-----------
Goto Document Properties--->Trigger---->OnPostReload--->Add Action--->Add---> External--->Run Macro---> give macro name(Export)
I am putting a semi colon after
msgbox("Done")
But the code is not creating any excl sheet.
Also can u tell me the significance of 4 in
obj1.Export "D:\InnerJoin.xls",4
Reload the attached file
The following code creates the Excel sheet in correct format.
sub Export
set obj1 = ActiveDocument.GetSheetObject("TB01")
obj1.ExportBiff "C:\Documents and Settings\596732\Desktop\manasvi\InnerJoin.xls"
msgbox("Done")
end sub
Cheers!!!!!!!!!!!!!!
Hi Ankit,
You are limited in what you can do during the reload script with regards to firing a macro to write to Excel. Firing a macro like the one above will be fine on post reload - but I'm not sure it will fire correctly if refreshed from QlikView Server.
The simplest way to export data for use in Excel during reload is to do it as a CSV file, a simple store statement can be used to do this:
STORE TableName INTO .\DataFile.csv (txt);
If you want formatted Excel output then you need to look at a product such as NPrinting, which allows you to write to a pre-defined template, with headers, different fonts and multiple tabs.
Please get in touch if you would like more information about NPrinting.
Hope that helps,
Steve
Hi Steve,
I would like to know more about NPrinting.