Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I got a document that binary reads from another document that has section access
Now I don't want users who open the first document to supply a user name and password
is there a way to pass the userName and password using a macro on the OnOpen trigger
Try something like the following.
Stephen
rem ** VBScript **
set App = ActiveDocument.GetApplication
App.OpenDoc "C:\MyDocuments\Budget.qvw","user",false,"jnn","123456",""
rem ** Visual Basic **
dim App as New QlikView.Application
set newdoc = App.OpenDoc ("C:\MyDocuments\Budget.qvw","admin",false,"jnn","123456","")
I think I missunderstood your question. You want to "automatically" pass the userName and password, so my code above is not what you want.
If you are wanting to grant users access to the second (Reader) document but prevent access to the first (Source) document, you can just define a new Section Access in the second document to replace the original security.
If the security needs to be cumulative, then to pass the security from Source to Reader, you would need to do the following (although this might be considered a security issue) ...
In the source document pass the security into hidden fields as thus ...
set HidePrefix='^^^' ;
Section Access;
SecTable:
LOAD * INLINE [
ACCESS, USERID, PASSWORD
admin, user1, pwd1
admin, user2, pwd2
];
Section Application;
Security:
LOAD
ACCESS AS ^^^ACCESS,
USERID AS ^^^USERID,
PASSWORD AS ^^^PASSWORD
resident SecTable;
In the Reader document ...
binary SecDoc1.qvw;
Section Access;
LOAD
^^^ACCESS as ACCESS,
^^^USERID AS USERID,
^^^PASSWORD AS PASSWORD
RESIDENT Security;
LOAD * INLINE [
ACCESS, USERID, PASSWORD
user, user3, pwd3
];
Section Application;
DROP TABLE Security;
You would need to integrate NTNAME into the security to automatically allow users into the documents.
flipside