Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Selections shown when export to excel option?

When you print or export to a pdf, the current selections are shown too.  When I export to excel, the current selections are not shown.  Can we, and if so how, can we export to excel with the current selections attached too?

Thanks!

2 Solutions

Accepted Solutions
m_woolf
Master II
Master II

in the code you need to change the "CH252" to the object ID for the chart you want to export

in the code you need to change the "CS12" to the object ID for the selection box you want to export

View solution in original post

Not applicable
Author

Well there is a fix on the support site for AJAX, but it breaks the export selections in IE explorer plugin for us (which was working).

How to Include Current Selectionswhen Exporting to Excel from AJAX

               

 

Description

 
             
   

When exporting to Excel you can include    the current selections by activating a user setting in IE-plugin/Desktop.
    To get the same behavior when using AJAX the same setting needs to be    activated server side in the settings.ini file.

   
 
 

Resolution

 
             
   
  • Stop the service "QlikView Server"
  • Open the file settings.ini (located in    C:\ProgramData\QlikTech\QlikViewServer or C:\Documents and Settings\All    users\ApplicationData\QlikTech\QlikViewServer depending on OS)
  • Add the parameter SelectionStampInBIFFExport=1 in the    section labeled [Settings 7]
  • Save the file
  • Restart the service "QlikView Server"
                   
 
 

Tags

 
 

Server/Publisher, AJAX, Export, Excel, Current Selections

 

View solution in original post

16 Replies
m_woolf
Master II
Master II

This can be done with a macro:

sub ExportWithSelections
      Set XLApp = CreateObject("Excel.Application")
      XLApp.Visible = True 
      Set XLWorkbook = XLApp.Workbooks.Add
      Set XLSheet = XLWorkbook.sheets("Sheet1")
      XLSheet.Range("A3").Select

rem ** copy full chart details to clipboard **
      ActiveDocument.GetSheetObject("CH252").CopyTableToClipboard false
      XLSheet.Paste ' -4163    'values

      XLSheet.Range("J2").Select

rem ** put current selection in J2 **
      ActiveDocument.GetSheetObject("CS12").CopyTableToClipboard true
      XLSheet.Paste ' -4163    'values
      XLApp.Selection.WrapText = False

      set XLSheet = nothing
      set XLWorkbook = nothing
      set XLApp = nothing

end sub

Not applicable
Author

The only thing is where do I put this macro?  If someone is opening the QV document through a web portal, will they beable to use this macro?  Can I incorporate it with the QV document so that it will append the selections no matter the version of excell someone open into?

m_woolf
Master II
Master II

Tools|Edit Module opens the macro editor.

This macro requires System Access.

It will work if your users are opening with the IEPlugin. I don't know if it will work with Ajax.

Once the macro is entered. You need to create a button object and set the button acrtion to run the macro.

Not applicable
Author

Sorry mwoolf.  I've not made a macro in QV before.  When I add it and create a button and set the action of the button to Run Macro with the name of the macro I created, it only opens the edit module window with the macro code. 


What am I missing?

m_woolf
Master II
Master II

in the code you need to change the "CH252" to the object ID for the chart you want to export

in the code you need to change the "CS12" to the object ID for the selection box you want to export

Not applicable
Author

Thanks mwoolf.  That does work, but what I really want is just when people right click on any chart and choose to export in excel, that it will export with selections. 

I know these options exist under document properties.  But it doesn't work when I try to download a chart from a dashboard in production.

Not applicable
Author

Hi Brandon,

Did you try the following on the prod server? : User preferences-Exports-Selection Stamps in Exports- On BIFF exports- checked

Not applicable
Author

We're still using 10.4, so we don't have Selections Stamps but rather Selections for Current selection box.  Clicking those two boxes doesn't work with the production server when you right-click and export to excel though at least not for "Open with AJAX zero footprint" or when you do it with a different browser (It does work with IE plugin.)

natebrunner
Contributor III
Contributor III

Did you ever come up with a solution to this? I'm wondering the same thing if I can get the selections to appear when sending a table box of data to Excel.