Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Macro to export Script Module and Table Viewer

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

17 Replies
shaikbakshu
Contributor
Contributor

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.

marcus_sommer

Here are various examples how objects could be exported to excel: https://community.qlik.com/search.jspa?q=excel+export&type=document

- Marcus

shaikbakshu
Contributor
Contributor

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.

marcus_sommer

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

shaikbakshu
Contributor
Contributor

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_IDEMPLOYEES
FIRST_NAMEEMPLOYEES
JOB_IDEMPLOYEES
JOB_IDJOB_HISTORY
SALARYEMPLOYEES
DEPARTMENT_IDEMPLOYEES
DEPARTMENT_IDDEPARTMENTS
DEPARTMENT_NAMEDEPARTMENTS
LOCATION_IDDEPARTMENTS
EmployenumberJOB_HISTORY
START_DATEJOB_HISTORY
shaikbakshu
Contributor
Contributor

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$TableEMPLOYEESDEPARTMENTSJOB_HISTORY
JOB_ID JOB_ID-JOB_ID
DEPARTMENT_ID DEPARTMENT_IDDEPARTMENT_ID-
EMPLOYEE_ID EMPLOYEE_ID--
FIRST_NAME FIRST_NAME--
LAST_NAME LAST_NAME--
EMAIL EMAIL--
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

marcus_sommer

For pivoting a table take a look on this : Re: Pivoting in macro

- Marcus

shaikbakshu
Contributor
Contributor

Hi Marcus,

Thank you for this post. It is very use full to me.

Thanks lot.

Thanks,

Bakshu.