Setting up a record-level security policy for a report

The following example shows you how to set up a record-level security policy for a report:

  1. Click File > Open in JReport Designer.
  2. In the Open Report Set dialog, click the Browse button to open the catalog file SampleReports.cat in <install_root>\Demo\Reports\SampleReports, then open the sample report EmployeeInformation.cls.
  3. In the Report Inspector, select EmployeeInformation in the Datasets node.
  4. In the Security section of the Properties panel, click to the right of the Record Security property entry to open the Record Level Security Information dialog. See the dialog.
  5. Click the Add button to add a condition line and edit the security information as required by clicking corresponding cells.

    Since the record-level security policies are file-based, you can just create a new text file, add the security settings, and then link the file to your report. Below are steps detailing how to import the security information from a text file.

    1. In the Record Level Security Information dialog, click the Import Text button.
    2. In the Select Record Level Security File dialog, specify the text file that contains the predefined security information and click Open.
    3. Information set in the text file will be displayed in the Record Level Security Information dialog. Click the cells to edit them if required.
    4. Click OK to make the security policy applied.
  6. Click OK to close the dialog.
  7. Click the View tab to view the report. You will then be prompted to provide security ID (SID), which refers to the user name. Type the SID, and then click OK. Only the records which satisfy the condition will be displayed.

Notes: