Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Sir/Madam,
I have a question about how to run a qlikview file using batch file (.bat file) with usrid and password pass in.
For example.
I have section access like:
Section
Access;
LOAD * INLINE [
ACCESS, USERID, PASSWORD, GROUP
ADMIN, A, passwordA,AD
USER, B,passwordB, G1
];
Section Application;
STAR IS *;
GROUP:
LOAD * Inline [
GROUP, GENDER
AD, *
G1, F];
Can I use Command to pass the for example User A to the QlickView file?
Something Like: "C:\Program Files\QlikView\qv.exe" /R /vvUSERID = A /NoSecurity "test.qvw"??
Thanks a lot,
Vicky
Hi,
I answered to the same exact question some time ago here. Please check the code and come back if necessary. You cannot pass the USERID by command line, rather the user must be in the section access with full permissions, as described in the post linked above. Do not use the /NoSecurity flag here.
Hope that helps.
Miguel
Hi Miguel,
Thank you for your answer first, but our problem is, we suppose to use a .net service to copy the whole file and pass the user account in and reducing the data and send the file to the user.
All the process are happening on the server not related to the User Account.
How it could happen?
Thanks,
Vicky
Hi Vicky,
Assuming you are not using QlikView Server, which will do this (specially if you have a Publisher license) whenever you want to reload from command line a section access protected QlikView file you will have to add the system account that is going to execute the command into the section access, so in first place the document can be reloaded with all it's data.
If you want, once reloaded, the document to be reduced, then again you will need to use an account that is linked to some field in section access. You will need to make some external program to make the command log into the QlikView document with a different USERID and PASSWORD, making the program entering the user name and password each time.
Hope that helps.
Miguel
Vicky,
You must include field ACCESS in table GROUP.
Hope that helps,
Damián. //
Hi,
I just got the solution to use batch file for auto reloading of document having "Section Access".
Add NTNAME in Section_Access Table / Excel file like below.
ACCESS | USERID | PASSWORD | TERRITORY | NTNAME |
ADMIN | ADMIN | ADMIN | * | * |
USER | USER | USER | * | * |
ADMIN | QV_IMRAN | abcc | KARACHI | * |
ADMIN | * | * | * | IMRANKHAN\IMRAN |
NTNAME is the Windows user who supposed to run BATCH file. TERRITORY is my city to filter data for user.
You can get the full user name by putting " =upper(OSUser()) " in text box at qlikview document. (snapshot is attached)
Use below script in Load statement to upload above table (excel file) in Qlikview document.
section access;
trace <<< Section Access >>> ;
Access:
LOAD Access as ACCESS,
UserID as USERID,
Password as PASSWORD,
upper(Territory) as TERRITORY_SA,
NTNAME
FROM
[QVDs\USER_RIGHTS.xlsx]
(ooxml, embedded labels, table is SA);
trace <<< Section Application >>> ;
section Application;
Dont forget to put check on "Initial Data Reduction based on Section Access" and "Strict Exclusion" under Document Properties > Opening tab.
Use below script in Batch file for Auto Reloading. You can set this BATCH file into Windows Task Scheduler.
"C:\Program Files\QlikView\qv.exe" /R "D:\My Data\QlikView\\POPSalesQVW.qvw"
Exit