Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm developing a macro that allow me to export to text (.txt , word, etc.) all text inside Script Module (not hidden script, only visible) and export to image the table viewer of document (PNG, JPG, etc.)
I search on API guide and Qlik Community but I didn't found anything.
Does anybody know if it possible to do this with macro VBA? Can anybody help me?
Thanks in advance,
Daniel
Hi Marcus,
Thank you for your Quick Response, I have one more clarification of the above,
If it is any possible to write Macros/Script to Export "System Table" Object from New Sheet Object into Excel sheet or Text file.
Thanks,
Bakshu.
Here are various examples how objects could be exported to excel: https://community.qlik.com/search.jspa?q=excel+export&type=document
- Marcus
Hi Marcus,
Thank you for this,
In that link one Post is "Table Viewer Table Automatically generated and Export to Excel" it this "Northwest.qvw" application Macro was not shown,
could you please help me to write macros for this scenario.
Thanks,
Bakshu.
Here an appropriate example from the APIGuide.qvw to create such a table:
rem Create HLO system table on new sheet
set Sheet=ActiveDocument.CreateSheet
set Hlo=Sheet.CreatePivotTable
Hlo.AddDimension "$Field"
Hlo.AddDimension "$Table"
Hlo.AddExpression "Only([$Field])"
set Prop = Hlo.GetProperties
Prop.TableProperties.PivotAlwaysFullyExpanded=true
Prop.Dimensions(0).SortCriteria.SortByAscii=0
Prop.Dimensions(0).SortCriteria.SortByLoadOrder=1
Prop.Dimensions(1).SortCriteria.SortByAscii=0
Prop.Dimensions(1).SortCriteria.SortByLoadOrder=1
Prop.TableProperties.NumberOfLeftDimensions=1
Hlo.SetProperties Prop
For exporting them take a look within the various examples from the link above.
- Marcus
Hi Marcus,
Thanks a lot for shared Macro for generate .XL file.
It is very use full to me what I got requirement.
Could you please help me to some modifications on that Macro.
Actually my requirement is bellow.
So could you please help me to write macro for this .
Thanks,
Bakshu
$Field | $Table |
EMPLOYEE_ID | EMPLOYEES |
FIRST_NAME | EMPLOYEES |
JOB_ID | EMPLOYEES |
JOB_ID | JOB_HISTORY |
SALARY | EMPLOYEES |
DEPARTMENT_ID | EMPLOYEES |
DEPARTMENT_ID | DEPARTMENTS |
DEPARTMENT_NAME | DEPARTMENTS |
LOCATION_ID | DEPARTMENTS |
Employenumber | JOB_HISTORY |
START_DATE | JOB_HISTORY |
Hi Marcus,
Thanks a lot for shared Macro for generate .XL file.
It is very use full to me what I got requirement.
Could you please help me to some modifications on that Macro.
Actually my requirement is bellow.
So could you please help me to write macro for this .
$Field | $Table | EMPLOYEES | DEPARTMENTS | JOB_HISTORY |
JOB_ID | JOB_ID | - | JOB_ID | |
DEPARTMENT_ID | DEPARTMENT_ID | DEPARTMENT_ID | - | |
EMPLOYEE_ID | EMPLOYEE_ID | - | - | |
FIRST_NAME | FIRST_NAME | - | - | |
LAST_NAME | LAST_NAME | - | - | |
- | - | |||
PHONE_NUMBER | PHONE_NUMBER | - | - | |
HIRE_DATE | HIRE_DATE | - | - | |
SALARY | SALARY | - | - | |
COMMISSION_PCT | COMMISSION_PCT | - | - | |
MANAGER_ID | MANAGER_ID | - | - | |
DEPARTMENT_NAME | - | DEPARTMENT_NAME | - | |
Managernumber | - | Managernumber | - | |
LOCATION_ID | - | LOCATION_ID | - | |
Employenumber | - | - | Employenumber | |
START_DATE | - | - | START_DATE | |
END_DATE | - | - | END_DATE | |
Departmentnumber | - | - | Departmentnumber |
Thanks,
Bakshu
For pivoting a table take a look on this : Re: Pivoting in macro
- Marcus
Hi Marcus,
Thank you for this post. It is very use full to me.
Thanks lot.
Thanks,
Bakshu.