Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Luminary
Luminary

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
Highlighted
MVP & Luminary
MVP & Luminary

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
Highlighted
Partner
Partner

Hi Daniel,

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

Regards,

Sergey

Regards,
Sergey
Highlighted
Luminary
Luminary

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

Highlighted
MVP & Luminary
MVP & Luminary

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

Highlighted
Partner
Partner

Markus gave you an example.

Just in case whether it could be helpful QlikView App Documentation

Regards,

Sergey

Regards,
Sergey
Highlighted
Luminary
Luminary

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

Highlighted
Luminary
Luminary

Thank you Sergey!

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

Highlighted
MVP & Luminary
MVP & Luminary

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

Highlighted
Contributor
Contributor

Hi Marcus,

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

Thanks,

Bakshu.

MVP & Luminary
MVP & Luminary

AFAIK this isn't possible.

- Marcus