Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Clearing selection and setting sheet on Publisher reload (qv9)

Hi There,

I am looking to get selections cleared and default page set when publisher reloads data, as presently if the document is saved with selections by mistake that default selection persists until someone sorts it out.

I have attempted a solution that goes like this:

Created a variable osUser, with a value of =OSUser()
Set OnPostReload event to fire PublisherClearSelections
Created the macro PublisherClearSelections as below


sub PublisherClearSelections
vOSUser = ActiveDocument.GetVariable("osUser").GetContent.string

if instr(vOSUser, "QVPublisher") > 0 then
ActiveDocument.ClearAll
ActiveDocument.ActivateSheet("Home")
end if
end sub


This works fine in QV Developer, but doesn't seem to work when kicked off by Publisher. I am reasonably confident in the OSUser name being right for our environment.

I would have expected a way of doing this in the Reload script, rather than relying on a trigger occurring, but I have not found a way of doing this.

Any suggestions welcome.

Thanks,
Steve

1 Solution

Accepted Solutions
Bill_Britt
Former Employee
Former Employee

Steve,

Marcos cannot be ran by publisher. QVS 9 reference manual page 224. "

QlikView Distribution Service does not execute any macros that may exist in

the Source Document."

You could do an "on open" marco that when the document is open it would do these. Then the server went it open the document would run the macro.



Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.

View solution in original post

4 Replies
Bill_Britt
Former Employee
Former Employee

Steve,

Marcos cannot be ran by publisher. QVS 9 reference manual page 224. "

QlikView Distribution Service does not execute any macros that may exist in

the Source Document."

You could do an "on open" marco that when the document is open it would do these. Then the server went it open the document would run the macro.



Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.
Not applicable
Author

Hi there,

Well spotted on the fact that publisher will not execute macros.

Your suggestion of using OnOpen works fine.

Many thanks,
Steve

Not applicable
Author

My question is that if the model is having on several occasions, as an example 15 times a day, runs the 15 times?
sukydhak
Partner - Contributor III
Partner - Contributor III

Guys

I have another problem.

At present, i'm using QT for polling data from a number of xls file and have a marco that inserts this data into our forecast system. The issue is my reload runs via the server but someone has to open the qvw to push the button to insert the data into the database.

Can this all run via the server?