Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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

1 Solution

Accepted Solutions
marcus_sommer

The script could be automatically exported but (AFAIK) the pictures from table viewer not. See here an example from APIGuide.qvw to access the script:

rem ** add new line to script **

set docprop = ActiveDocument.GetProperties

docprop.Script = docprop.Script & "Load * from abc.csv;"

ActiveDocument.SetProperties docprop

- Marcus

View solution in original post

17 Replies
SergeyMak
Partner Ambassador
Partner Ambassador

Hi Daniel,

Could you clarify your idea? Why do you need it?

Regards,

Sergey

Regards,
Sergey
Anonymous
Not applicable
Author

Hi Sergey,

Thanks for your answer and attention.

I'm doing a macro to develop automatic documention of a QlikView project. So, the reason that I need this is to put this information in a text document. So, my question is:

Is there any way to export the script of QlikView document and image of  data model (that I see in table viewer)? (with a function or another idea). I didn't find anything helpfhul in API Guide...

Thanks for your help.

Daniel

marcus_sommer

The script could be automatically exported but (AFAIK) the pictures from table viewer not. See here an example from APIGuide.qvw to access the script:

rem ** add new line to script **

set docprop = ActiveDocument.GetProperties

docprop.Script = docprop.Script & "Load * from abc.csv;"

ActiveDocument.SetProperties docprop

- Marcus

SergeyMak
Partner Ambassador
Partner Ambassador

Markus gave you an example.

Just in case whether it could be helpful QlikView App Documentation

Regards,

Sergey

Regards,
Sergey
Anonymous
Not applicable
Author

Thanks for your answer Marcus!

I use this code to extract all script of my QlikView document to txt file:

vRutaETL = ActiveDocument.GetVariable("vRutaETL").GetContent().String     

CONST ForWriting = 2

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set ficheroTXT = objFSO.OpenTextFile (vRutaETL, ForWriting, True)

ficheroTXT.WriteLine(ActiveDocument.GetProperties.Script)

ficheroTXT.Close()

So, it's imposible to export an image of data model of  my QlikView document?

Best regards,

Daniel

Anonymous
Not applicable
Author

Thank you Sergey!

I don't know about this QlikView App Documentation. It's a good sample to learn how programar VBA in QlikView.

marcus_sommer

I believe there isn't any (documented) way to automate the export from the table viewer. The only documented access is the print settings:

set docprop = ActiveDocument.GetProperties

docprop.TableViewerPrintSettings.Landscape = true

ActiveDocument.SetProperties docprop

but maybe there is more - undocumented or there is something within the easter egg ...

- Marcus

shaikbakshu
Contributor
Contributor

Hi Marcus,

Could you please share any script/macro to automate 'Export Structure'(.Mappings file) in 'Internal Table View'.

Thanks,

Bakshu.

marcus_sommer

AFAIK this isn't possible.

- Marcus