Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

daniel_garcia_m
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
Not applicable

Re: Macro to export Script Module and Table Viewer

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

17 Replies
sergey_maka8
Not applicable

Re: Macro to export Script Module and Table Viewer

Hi Daniel,

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

Regards,

Sergey

daniel_garcia_m
Not applicable

Re: Macro to export Script Module and Table Viewer

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
Not applicable

Re: Macro to export Script Module and Table Viewer

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

sergey_maka8
Not applicable

Re: Macro to export Script Module and Table Viewer

Markus gave you an example.

Just in case whether it could be helpful QlikView App Documentation

Regards,

Sergey

daniel_garcia_m
Not applicable

Re: Macro to export Script Module and Table Viewer

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

daniel_garcia_m
Not applicable

Re: Macro to export Script Module and Table Viewer

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
Not applicable

Re: Macro to export Script Module and Table Viewer

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
Not applicable

Re: Macro to export Script Module and Table Viewer

Hi Marcus,

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

Thanks,

Bakshu.

marcus_sommer
Not applicable

Re: Macro to export Script Module and Table Viewer

AFAIK this isn't possible.

- Marcus