Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tdegen_qlik
Contributor
Contributor

Export to csv from UI and let user download in a browser

My users access our dashboards through a browser.  I want them to be able to export data from a straight table to a csv file.

Here's the catch, we do medical research and these files are used to populate cohorts for databases.  The CSV file I want to export has 7,052 columns and a few thousand rows.   I cannot show that volume of data on the screen - it kills performance.

 

Instead I put the straight table on a hidden sheet and use a button and macro to create the csv.   This works beautifully in the designer.  How do I get it to work in a browser?

 

Here's a test macro which works in the designer (this code writes from the 'active' sheet for simplicity):

 

Sub exportToCsv()

Set obj = ActiveDocument.GetSheetObject("HIDDEN")

obj.Export "c:\temp\Extract.csv", ","

Set obj = nothing

End Sub

 

I've tried writing the files to public directories, web directories, paths identified in the directory services of the QVMC - none of them seem to work for users who access the product through a browser.


Does anyone have any experience creating files of any type on the fly and distributing them to the user through a browser?

Labels (1)
1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Use the ServerSideExportEx call instead:

Set obj = ActiveDocument.GetSheetObject("HIDDEN")
obj.ServerSideExportEx "C:\test.csv" ,"," ,1   '0=HTML, 1=Text, 2=Bitmap, 3=XML, 4=QVD, 5=BIFF

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com