The ASP Report Wizard was built with internet and data security issues as a major requirement. To achieve some of these requirements, the Report Wizard comes with certain properties that can be used to hide certain tables, views, report groups and even table fields.

These properties can be set programatically be the developer depending on which user is viewing reports. These properties include: HiddenTables, HiddenReports, HiddenFields,UseTables, UseReports etc.. Below is a list of these properties and their sample usage:
  1. HiddenTables
    This property can be used to hide a group of tables or views if the current user does not meet certain requirements. For example you can hide the budget table if the current user is not from the budget department as follows:
    <%
    If Not (Session("UserDept") = "BUDGET") Then
    	objWiz.HiddenTables = "budget,salary"
    End If
    %>
    
  2. HiddenReports
    This property can be used to hide a group or groups of reports if the current user does not meet a certain criteria. For example you can hide all reports in the in in groups A and B if the current user is not from the budget department as follows:
    <%
    If Not (Session("UserDept") = "BUDGET") Then
    	objWiz.HiddenReports = "A,B"
    End If
    %>
    
  3. HiddenFields
    This property can be used to hide some table fields if the current user does not meet a certain criteria. For example you can hide the SalaryField if the current user is not in management as follows:
    <%
    If Not (Session("UserDept") = "MNGT") Then
    	objWiz.HiddenFields = "Salary,UserID"
    End If
    %>
    
  4. HideTables & HideViews
    You can also use the HideTables, HideViews & HideProcedures properties to hide all tables, all views or stored procedures.
    <%
    If Not CBool(Session("CanViewTables")) Then
    	objWiz.HideTables = True
    End If
    %>
    
  5. UseTables
    You can also use the UseTables property to set the tables and views a user is allowed to see. For example:
    <%
    'Declare your variables
    Dim strTablesAllowed
    Select Case Session("UserDept")
    	Case "HR" : strTablesAllowed = "Table1,Table2,Employees"
    	Case "MNGT" : strTablesAllowed = "Table1,Budget,Table5"
    	Case Else : strTablesAllowed = "Survey"
    End Select
    objWiz.UseTables = strTablesAllowed
    objWiz.Init(Connection String)
    %>
    
  6. UseReports
    The UseReports property works much like the UseTables property above but sets the report groups a user is allowed to see.
     
  7. UseProcedures
    You can programatically set the stored procedures you want displayed by use of the UseProcedures property. For example:
    <%
    objWiz.UseProcedures = "Procedure1,@Param1='Value1',@Param2='Value2'|Proc2,@P1=10,@P2='V2'" 
    objWiz.Init(Connection String)
    %>
    
    This property automatically sets the stored procedures to be used with their parameters and as such, users cannot edit the parameter values.
See Also