To integrate Visual Guard in your report Reporting Services you have to:
Add the assemblies of Visual Guard as references of your project.
Integrate Visual Guard in the code of your application.
Create a Visual Guard repository and declare your application by using the
Visual Guard console. This repository will contain all security items (users,
roles, permissions ...) of your application.
Generate the Visual Guard configuration
files by using the Visual Guard console. These configuration files will be
needed to connect your application to the repository.
Grant read/write permissions to the repository.
Referencing Visual Guard assemblies
In order to use Visual Guard, you must add references to Visual Guard assemblies:
Opens the solution of your project in Visual Studio.
In the solution explorer, expands the project node.
Right-click the Project node for the project and select Add Reference
from the shortcut menu.
In .Net tab, select the 3 assemblies Novalys.VisualGuard.Security,
Novalys.VisualGuard.Security.<ProjectType> (WinForm,
ASP.net),
Novalys.VisualGuard.Security.<RepositoryType> (File, SQLServer or Oracle).
Click the Select button, and then
click the OK button
Note: In the list of assemblies, Visual Studio can display different
versions of the Visual Guard assemblies. You must select the assembly
corresponding to the version of the framework used in your project.
If the assemblies does not appear in this list you can use the Browse tab
and select them in the directory <Visual Guard installation
directory>/bin/3.1
Note: Once the Visual Guard assemblies are referenced into project, you need to mark "Copy Local" property to "true" for each assembly.
Description of Visual Guard assemblies:
Novalys.VisualGuard.Security contains the main Visual Guard classes.
Novalys.VisualGuard.Security.Files contains the classes needed to access
to a file based repository.
Novalys.VisualGuard.Security.SQLServer contains the classes
needed to access to a repository stored in a Microsoft SQLServer database
(SQLServer 2000 or higher). Available only in
Visual Guard Enterprise Edition
Novalys.VisualGuard.Security.WebForm contains the classes
needed to ASP.Net application. You must reference this assembly in ASP.Net
WebSite or ASP.Net WebService project.
Novalys.VisualGuard.Security.WinForm contains all classes based on WinForm
control. This assembly is needed only if you use the forms provided by Visual
Guard to authenticate, change a password or select a role. If you want to use
your own form you do not need to add a reference to this assembly.
To filter data in a report Crystal report you have to:
Create parameters in your dataset,
Create a property to initialise your parameter,
Intialise the parameter of the report with the property,
Create a permissions in Visual Guard.
Create a parameter in your dataset
To create a paremeter in your report:
Open the dataset,
Select the querry in the data Adapter,
Modify the command text to create a filter in the querry,
Create a property to initialise your user name
In your form with the report viewer, create a property.
public string User { get; set; }
Intialise the parameter of the report with the property
In your form with the report viewer .
private void Form1_Load(object sender, EventArgs e)
{
//Execute the querry and intialise the parameter with the propertythis.vg_LogTableAdapter1.Fill(this.MyDataSet.vg_Log, User);// Execute the reportthis.reportViewer1.RefreshReport();
}
Create a permissions in Visual Guard
Open Visual Guard Console,
Select your application,
Create a new Permission (cf: Create a new Permission in the
documentation "Visual Guard Win Console"),
Create a new Argument on the permission (cf: Edit Argument list
in the documentaion "Visual Guard Win Console"),
Create a property action (cf:Properties actions in the
documentation "Visual Guard Console"),
Select the form where you create the property,
Select your property in the property grid (user),
Click on "add Expression",
Select " Current UserName",
Click on "Ok",
Click on "Finish".
Now when you execute your application, the report is filter with the
connected user.