Exporting a Section Report as a Password-Protected PDF in Elipse E3.

Question

How can I generate and export a Section Report as a password-protected PDF, so that a password is required when opening the file?


Solution

The Section Report allows you to view and print real-time values of system variables, as well as data stored in a Database (Alarms, Historical data, Queries, and Formulas).

To insert a Section Report:

  1. In Domain mode, right-click Visualization – Reports in the Organizer.

  2. Select Insert Section Report in.

  3. Choose the desired project.

It is possible to export the report as a password-protected PDF, ensuring additional security when sharing the document.

To do so, use the OwnerPassword and UserPassword properties, available through the GetExportFilter method of the report.

The script must be added to the event responsible for generating the report (usually the Click event of a button, such as Generate Report).

Script example 

Set Report = Application.LoadReport("SectionReport")
Set exportfilter = report.GetExportFilter("PDF") 
exportfilter.OwnerPassword = "Password" 
exportfilter.UserPassword = "Password" 
exportfilter.UserPermissions ="16"
report.Export exportfilter, "C:\Report.pdf"


Properties used

OwnerPassword
Defines the owner password of the exported PDF file.

UserPassword
Defines the password required to open the exported PDF file.

UserPermissions
Specifies the permissions granted to the user of the exported PDF file.

Available values:

  • 0 – rv2PermissionNone: No permissions

  • 4 – rv2PermissionPrint: Print permission only

  • 8 – rv2PermissionModifyContents: Permission to modify content

  • 16 – rv2PermissionCopy: Permission to copy content

  • 32 – rv2PermissionModifyAnnotation: Permission to modify annotations

  • 256 – rv2PermissionFillIn: Permission to fill in forms

  • 512 – rv2PermissionAccessibleReaders: Permission to open the file in accessibility-enabled devices

  • 1024 – rv2PermissionAssembly: Permission to insert, remove, and rotate pages, as well as create thumbnails and bookmarks, even if modify content permission (8) is not granted

By default, the user has all permissions, which corresponds to the sum of all values above.


Remarks

  • It is recommended to define strong passwords to prevent unauthorized access.

  • Permissions can be combined by summing the desired values.

  • For more details about export filter properties and methods, refer to the Elipse E3 Reference and Scripts Manual.

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *