Successfully!

Error!

Import Users

  • Last update:  2021-09-02
  • I. Overview

    1) Given the large number of employees in an enterprise and changing user information due to high personnel mobility, it will be a heavy workload to add or modify user information manually. 

    2) The function of importing users provides a convenient way to add users for companies who have existing user data.

    3) Administrators can import multiple times. Platform users can be a collection of multiple datasets.

    II. Prepare User Data

    User data can be Non-hierarchical in department or Hierarchical in department according to the company requirement.

    1) For non-hierarchical department datasets, department positions imported are lateral and there is no parent or child department.

    2) For hierarchical department datasets, a department can have parent or child department, and must be using tree dataset structure.


    1. Non-hierarchical department dataset - SQL

    1) Prepare a user information table

    This section takes the table userinfo in the database FRDemo for example. The table is listed below:

     1.png

    Note:

    • In the configuration of a imported dataset, [Username], [Name] and [Password] are required fields, but you can select the same data column. Therefore, a user information table must contain either [Username] or [Name].

    • The report version 10.0.12 and later supports binding mobile phone numbers in China Mainland, Taiwan-China, Hong Kong-China, Turkey, Korea, Japan, Singapore, and Malaysia.

    • In Taiwan-China, South Korea, Japan, Malaysia and other regions, there is no need to add 0 after the area code or before the mobile phone number.

    2) Import the table into the server dataset

    As user data should be selected from the server dataset, the table has to be added to the server dataset.

    Take platform operations as an example. An administrator logs on to the decision-making platform, and click [Manage]>[Data Connection]>[Server Dataset] to create a [SQL Dataset]. Name the dataset as [Userinfo] and select [FRDemo] as the data connection. Input the following SQL sentence:

    select *from userinfo

    Click [Preview] on the right side to preview data. If there is no error, click Save.

    image.png

    This non-hierarchical SQL dataset is added to the server.


    2. Non-hierarchical department dataset - File

    This method of file dataset import is only applicable for versions 10.0.12 and above. TXT and XML files are also supported.

    1) Prepare a user information table

    This section takes the table userinfo as the Excel file data for example. The table is listed below (same as that in the SQL method):

    image.png

    Note:

    • In the configuration of a imported dataset, [Username], [Name] and [Password] are required fields, but you can select the same data column. Therefore, a user information table must contain either [Username] or [Name].

    • The report version 10.0.12 and later supports binding mobile phone numbers in China Mainland, Taiwan-China, Hong Kong-China, Turkey, Korea, Japan, Singapore, and Malaysia.

    • In Taiwan-China, South Korea, Japan, Malaysia and other regions, there is no need to add 0 after the area code or before the mobile phone number.

    2) Import the table into the server dataset

    As user data should be selected from the server dataset, the table has to be added to the server dataset.

    Save this Excel locally or on server.

    Take platform operations as an example. An administrator logs on to the decision-making platform, and click [Manage]>[Data Connection]>[Server Dataset] to create a [File Dataset]

    image.png

    Name the dataset as [Userinfo_file]. And select the file mentioned above.

    • For server file, please select files under %FR_HOME%\webapps\webroot\WEB-INF\reportlets

    • For local file, it will be saved to %FR_HOME%\webapps\webroot\WEB-INF\reportlets\excel on server after uploading.

    Click [Preview] on the right side to preview data. If there is no error, click Save.

    image.png

    This non-hierarchical File dataset is added to the server.


    3. Hierarchical department dataset - Tree

    1) Prepare a user information table

    This section takes the table userinfo_treein the database FRDemofor example. The table is listed below:

    15.png

    Note:

    • In a user dataset, if the server dataset is a tree dataset, then did represents the department ID while fid represents the parent department ID. The parent department of the topmost department should be null. In the figure above, for example, the fid field of user Anna is null.

    • In the configuration of a imported dataset, [Username], [Name] and [Password] are required fields, but you can select the same data column. Therefore, a user information table must contain either [Username] or [Name].

    • The report version 10.0.12 and later supports binding mobile phone numbers in China Mainland, Taiwan-China, Hong Kong-China, Turkey, Korea, Japan, Singapore, and Malaysia.

    • In Taiwan-China, South Korea, Japan, Malaysia and other regions, there is no need to add 0 after the area code or before the mobile phone number.

    • As the table might not have been updated in the database FRDemo in the installation package, you may import the following file into the database if necessary:

    userinfo_tree.xlsx


    2) Import the table into the server dataset

    As a tree dataset should be generated from the server dataset, the table has to be added to the server dataset.

    Take platform operations as an example. An administrator logs on to the decision-making platform, and click [Manage]>[Data Connection]>[Server Dataset] to create a [SQL Dataset]

    Name the dataset as [Userinfo_tree] and select [FRDemo] as the data connection. Input the following SQL sentence:

    select *from userinfo_tree

    Click [Preview] on the right side to preview data. If there is no error, click Save.

    image.png

    3) Generate a tree dataset

    Build a tree dataset on this basis: create a new [Tree Dataset] named [Userinfo2], select [Userinfo_tree] as [Built from Dataset]. Check [Build tree according to the parent tag field of selected dataset]. Select [Column Name] for both tag fields and choose [did] as the original tag field and [fid] as the parent tag field.

    Click [Preview] on the right side to preview data. If there is no error, click Save.

    image.png

    image.png

    This hierarchical tree dataset is added to the server.

    III. Import Users

    Admin logs into the platform, click [Manage > User Management > All Users] and click [Import User] to configure user dataset information.

    image.png

    Explanation on the configuration items is as follows:

    1. Keep Information

    User in the server dataset
    User in the platformJar VersionKeep information checkbox
    Result
    ExistNot exist----Add this user info to the platform
    Not existExist----Platform user info unchanged

    Exist

    Exist

    and from [synchronized user]

    ----If there are same information for both imported and synchronized user, the duplicate info will not be updated.
    Exist

    Exist

    and from [imported user] or [added user]

    Before 2020-08-31--

    SQL dataset:

    • Name, Phone, Email, Password will be updated

    • Department, Role will be the union of original platform user info and dataset user info


    Tree dataset:

    • Clear all original info, and update from the dataset



    2020-08-31 and afterUnchecked
    • Name, Phone, Email, Password will be updated

    • Department, Role will be the union of original platform user info and dataset user info




    Checked
    • Name, Phone, Email, Password will not be updated

    • Department, Role will be the union of original platform user info and dataset user info


    2. Server Dataset

    Select the server dataset introduced in section II for importing.


    3. User Info Items

    Bind username, name, password, department, position, role, phone, email, etc. with corresponding fields in the server dataset.

    Note: 

    • Department and position cannot recover to the unimported status. They can only be deleted and added again.

    • The user email information configured for user management is used together with the system management email. Emails can be directly sent to user email addresses of different platforms through FineReport platform.

    • 10.0.14 and later report projects support only department configuration, not position configuration.

    • Report project before version 10.0.14, configure the department, must configure the position.


    4. Encryption Method

    1) Built-in SHA Encryption

    The platform will use SHA256 Encryption to ensure the security of passwords.

    2) Custom Password Encryption

    User can put customized encryption class under %FR_Home%\webapps\webroot\WEB-INF\classes, and select this class to encrypt.

    The platform will execute SHA256 again on the customized encryption to ensure security.

    Note: 

    • The custom encryption algorithm must inherit the AbstractPasswordValidator class and add a return method to determine whether the plaintext password and the ciphertext password are consistent.

    • Existing user info will not be cleared if encryption method stay unchanged when importing.

    IV. Existing User Management

    Please refer to User Management-Section II.


    Attachment List


    Theme: Decision-making Platform
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback