Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
michaelcostner
Contributor II
Contributor II

Set document title from variable

Hi Everyone,

Is it possible to set the title of a Qlikview document to the value of a variable?

Looking under Settings>Document Properties>General>Title, there is an option to put in an expression, but the title turns to the variable name, not the actual variable value.

I am using version 12 SR1.

Thanks!

Michael

1 Solution

Accepted Solutions
Peter_Cammaert
Partner
Partner

The Document Title expression button is one of those always-broken-features of QlikView. You can put anything in this field, but axpressions won't work.

Your second question is a bit contra-productive. QlikView has a very powerful server-based distribution system for its BI applications. All distribution/licensing/usage/management properties in QlikView server are tied to the filename of the QlikView document. You would get into a complete mess rather quickly if documents started changing their names.

OTOH, you can easily create some macro code that uses the "ActiveDocument.SaveAs" method to save a copy of the current document under a different name. Consult the APIGuide for an example.

Peter

View solution in original post

4 Replies
michaelcostner
Contributor II
Contributor II
Author

Sorry - need to rephrase my question.

I need to save my document with a variable value.

So, if I had a variable vName=doc_name, I'd like to automatically save the document as "doc_name.qvw".

Is that possible?

Peter_Cammaert
Partner
Partner

The Document Title expression button is one of those always-broken-features of QlikView. You can put anything in this field, but axpressions won't work.

Your second question is a bit contra-productive. QlikView has a very powerful server-based distribution system for its BI applications. All distribution/licensing/usage/management properties in QlikView server are tied to the filename of the QlikView document. You would get into a complete mess rather quickly if documents started changing their names.

OTOH, you can easily create some macro code that uses the "ActiveDocument.SaveAs" method to save a copy of the current document under a different name. Consult the APIGuide for an example.

Peter

View solution in original post

michaelcostner
Contributor II
Contributor II
Author

Thanks Peter - using ActiveDocument.SaveAs did the trick.

Michael

jamesdmilne
Contributor II
Contributor II

Hi Michael,

You can set the document title using a macro, variable, and a trigger.

1) Add the following macro:

SUB SetDocumentTitle()

    set dp = ActiveDocument.GetProperties

    set v = ActiveDocument.Variables("vDocumentTitle")

    dp.WindowTitle = v.GetContent.String

    ActiveDocument.SetProperties dp

END SUB

2) Add a variable vDocumentTitle.  It can use any valid expression.  If you are using a string constant do not enclose it in parentheses.

3) Add a document event trigger with an external action "Run Macro" and run the macro SetDocumentTitle.  I suggest adding the trigger to either the OnOpen, OnPostReload, or OnPostReduceData events.

James