Make your own Publisher in 46 lines

QlikView publisher enables you to create a distributed version of a QlikView document that contains reduced data. This is handy when you have a master document with all data in it, and you want to deliver it to users who should not view all data. But its really unusable from the perspective that you cannot make receive users from an external database like your ERP. Unless you manually wish to enter them one by one.

In the past we have used a script to insert these users into the Publisher MSSQL database. But this is tricky and not the most reliable method.

What we just have realized is that you can easily make your own publisher. Since all QlikView methods can be scripted with some simple VbScript. And the methods used in QlikView Publishers are available in the application.

What I suggest is to have a master document with all data (reload and all are handled in the usual way). And a VbScripts, that reads out the users from the source (and sets access rights) and then uses the QliView OCX control to create distributed versions of this script.

To do this you need to now, what users (their AD SamAccount name), what fields (where the reduced data will done) and the field values to keep.

Its basicly a 3 step process, read out all combinations of users and unique documents, then create all documents and then assign rights to each document. Their is a lot of QlikView expert knowledge in this that I won't go into detail with. The basic script is here:

' This should be read out from some master database
' Set the default field
strField = "Dim"
' Create a string of all needed combinations
strUserValues = "tse,jhe;value1:fhc;value2"
' Set the master document
strMaster = "C:\QlikView\Master\QvDoc.qvw"
' Set the save path
strSaveFolder = "C:\QlikView\Reduced\"

' VbScript lacks the comment a single char from 
' a string ability so we need this
dp = """"

' First split into versions
arrVersions = Split(strUserValues,":")
' Loop through all versions
For Each strVersion in arrVersions
  ' Spilt into users/value
  arrVersion = Split(strVersion,";")
  arrUsers =  Split(arrVersion(0),",")
  strValue = arrVersion(1)
  strSavePath = strSaveFolder&"reduced "&strField&":"&strValue&".qvw"
	
  Set qv = CreateObject("QlikTech.QlikView")
  Set objDoc = qv.openDocEx(strMaster,0,false,"","","",false)
	
  ' If necesary set multiple fields
  objDoc.Fields(strField).Select strValue
  objDoc.ReduceData

  objDoc.SaveAs strSavePath
  objDoc.GetApplication.Quit
	
  ' Loop all users and add file access rights
  For Each strUser in arrUsers
    strParameters = "%COMSPEC% /c Echo Y| cacls "_
           & dp & strSavePath & dp &"  /c /e /g "& strUser & ":F"
    WScript.StdOut.Writeline strParameters				
    intRunError = objShell.Run(strParameters, 2, True)
    If intRunError <> 0 Then
      WScript.StdOut.Writeline "Error assigning permissions for user " _
	   & strUser & " to home folder " & File.Name
    End If	
  Next		
Next

 

И хожено и вожено, да

И хожено и вожено, да легче нет.

This beautiful and

This beautiful and informative article, thank you very much. Use this page to your friend told you. I am constantly followed. To receive more information about this topic the following internet sites can follow.
Descargar programas Gratis, Descargar CustomizeGoogle 0.71, Descargar Leopard Huge Iconpack 650 Icons, Descargar Deluge 1.0.0, Descargar AVS Image Converter 1.2.1, Descargar Mozilla Thunderbird 3.0.4, Descargar FastStone Photo Resizer 2.9, Descargar Agnitum Outpost Firewall Pro 4.0.1007.7323, Descargar CDex 1.70Beta4, Descargar MWSnap 3.74, Descargar To-do List 2.2.3, Descargar Space Siege Demo, Descargar Portable Starter 5.6.2.8, Descargar ACDSee Photo Editor 2008 5.0.286, Descargar TM Icon Extractor, Descargar Image Constructor 1.5, Descargar Fishie Fishie, Descargar FILEminimizer Pictures 2.0, Descargar Reclip 2.2.2, Descargar iColor Folder 1.4.2, Descargar SmitFraudFix 2.387, Descargar Audio Librarian Plus 5.1, Descargar Michael Jackson Screensaver, Descargar 100 Free Spades 6.38, Descargar Jpeg Fixer 0.96, Descargar Power Spy for Home,