Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

matheus_silva
Contributor

Macro .csv

Hi folks.

Recently i open a discussion about macro to export to excel in qlikview server, and  we come to conclusion that is not possible if excel is not instaled in server...so i keep trying the others ways and i got this:

Sub ExportToCSV

          Set objFSO = CreateObject("Scripting.FileSystemObject")

          Set t2 = ActiveDocument.GetSheetObject("CH58")

          t2.Export "\\10.234.239.156\WeCanDoThat\teste.csv", ";", , TRUE

          Set objTextFile = objFSO.OpenTextFile ("\\10.234.239.156\WeCanDoThat\teste.csv", 8, True)               

          objTextFile.WriteLine("")          

          objTextFile.Close

          Set t2 = ActiveDocument.GetSheetObject("CH59")

          t2.Export "\\10.234.239.156\WeCanDoThat\teste.csv", ";", , TRUE

          Set objTextFile = objFSO.OpenTextFile ("\\10.234.239.156\WeCanDoThat\teste.csv", 8, True)               

          objTextFile.WriteLine("")          

          objTextFile.Close

          Set t2 = ActiveDocument.GetSheetObject("CH60")

          t2.Export "\\10.234.239.156\WeCanDoThat\teste.csv", ";", , TRUE

End Sub

I export to .csv, in server it works, it create and save the file...but in qlikview web, nothing happening...

I read some text about this, and saw something about ajax client, and ie plugin, but i dont undestand very well...

Anyone know what i do wrong....or it is not possible and i have to give up....XD

note: i allow all macro options in qliview.

Thanks!!!

1 Solution

Accepted Solutions
matheus_silva
Contributor

Re: Macro .csv

Hi...i found a way to export .txt or .cvs using macro in ajax client

ServerSideExportEx


Use in VBscript like this:

t2.ServerSideExportEx "D:\public\Rebaixa_Preco\rebaixaprecoqlikview.txt", ";" , true

or

t2.ServerSideExportEx "D:\public\Rebaixa_Preco\rebaixaprecoqlikview.csv", ";" , true

QlikView - ServerSideExportEx · GitHub

Thank everyone....

5 Replies
krishnacbe
Valued Contributor III

Re: Macro .csv

Hi

You have two questions here. Ajax and IE Plugin are two modes of viewing the dashboard in access point.

if you View Details Link in the thumb nail of the Dashboard you can switch to IE Plugin mode.

Macros doesn't work in Ajax mode. you need to switch to IE Plugin.

Hope this helps

MVP & Luminary
MVP & Luminary

Re: Macro .csv

Couldn't the user simply use the export-to-excel feature within the ajax-client (I assume that it's installed on the local user machines)?

- Marcus

matheus_silva
Contributor

Re: Macro .csv

Yes, he could, but he can export a chart once, and my objective(sorry, i not explained this in text above) is create a macro to export all chart one time for the same Excel spreadsheet...Because this i want create a macro  =/...

Thaks

MVP & Luminary
MVP & Luminary

Re: Macro .csv

Then you need to use the IE plugin as client or to install excel on the server. I know it's against pure IT doctrine " a server is a server and not ... bla bla bla" - but I couldn't see a real vulnerability regarding to security or performance.

- Marcus

matheus_silva
Contributor

Re: Macro .csv

Hi...i found a way to export .txt or .cvs using macro in ajax client

ServerSideExportEx


Use in VBscript like this:

t2.ServerSideExportEx "D:\public\Rebaixa_Preco\rebaixaprecoqlikview.txt", ";" , true

or

t2.ServerSideExportEx "D:\public\Rebaixa_Preco\rebaixaprecoqlikview.csv", ";" , true

QlikView - ServerSideExportEx · GitHub

Thank everyone....