Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
koushik_btech20
Creator
Creator

Macro for export a report in excel

I have attached a qvw where I have to export the report in excel through a Macro. Now the problem is , in the application there are three party.If user select 2 party from the listbox and then click the button 'Send to Excel' then it will export party wise two different excel means for Party PTY01 wise Sale Details in a excel and for Party PTY02 wise Sale Details in another excel.

1 Solution

Accepted Solutions
koushik_btech20
Creator
Creator
Author

The macro you have written in my app is not working properly.I want party wise break up into two sheet after selecting two party from the listbox and clicking on the button.

View solution in original post

6 Replies
ecolomer
Master II
Master II

I do not quite understand what you intend,

I am attaching a model export to excel if you can serve.

koushik_btech20
Creator
Creator
Author

After selecting two party from the listbox  and click the button 'Send to Excel ' what will be my desired output excel file after export has been attached. Please check and revert.

ecolomer
Master II
Master II

Here you are your file

jagan
Partner - Champion III
Partner - Champion III

Hi Koushik,

Check this thread hope it helps you.

Useful Qlikview Macros

Regards,

Jagan.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this code

  1. FUNCTION ExportObjectToJpg( ObjID, fName) 
  2.   ActiveDocument.GetSheetObject(ObjID).ExportBitmapToFile fName 
  3. END FUNCTION 
  4.  
  5. SUB ExportChartByListboxValues 
  6.   DIM fname, value, filePath, timestamp 
  7.   filePath = ActiveDocument.Variables("vPDFFlagPath").GetContent.STRING 
  8.   timestamp = Year(Now()) & DatePart("m", Now()) & DatePart("d", Now()) & DatePart("h", Now()) & DatePart("n", Now()) &     DatePart("s", Now()) 
  9.   SET Doc = ActiveDocument 
  10.   fieldName = "EmployeeID" 
  11.   SET Field = Doc.Fields(fieldName).GetPossibleValues 
  12.  
  13.   FOR index = 0 to Field.Count-1 
  14.   Doc.Fields(fieldName).Clear 
  15.   Doc.Fields(fieldName).SELECT Field.Item(index).Text 
  16.   fileName = Field.Item(index).Text & "_" & timestamp   & ".jpg"'Field.Item(index).Text & DateValue 
  17.   ExportObjectToJpg "CH420", filePath & fileName 
  18.   NEXT 
  19.  
  20.   Doc.Fields(fieldName).Clear 
  21. END SUB 

Regards,

Jagan.

koushik_btech20
Creator
Creator
Author

The macro you have written in my app is not working properly.I want party wise break up into two sheet after selecting two party from the listbox and clicking on the button.