#### Applying a connection-scope security policy to a report

To apply a connection-scope security policy to a report, follow the steps below:

1. In JReport Designer, open the report to which you intend to apply the security policy.
2. In the Report Inspector, select the node that represents the dataset the report uses in the Datasets node.
3. In the Security section of the Properties panel, select a required security policy for the Security Policy Name property. See illustration.

Notes:

- When you preview the report, the Security Identifier dialog will pop up. Type the user SID, and then click OK to see the result. You will not be able to view any records if the user SID you enter doesn't exist in the defined security policy.
- Security policies for the primary and subreport can be set and applied individually, with different combinations causing different results. The relationships between the security policy settings and the try-viewing results are shown in the following table:

  main | sub | Users in Policy | Users NOT in Policy
  --- | --- | --- | ---
  Ð | Ð | No security policy is applied to either the primary or sub report. Users can therefore view all records in the both main and sub report.
  Ï | Ð | Can view specified records in the primary report and all records in the sub report. | Can view no records in the primary report and all records in sub report.
  Ð | Ï | Can view all records in the primary report and specified records in the sub report. | Can view all records in the primary report and no records in the sub report.
  Ï | Ï | Can view specified records in both the primary and sub report. | Can view no records in either the primary or sub report.

  Ï - Security policy has been set and applied.
  Ð - Security policy has not been set and applied.