Jump to content
We've recently updated our Privacy Statement, available here ×
  • How to increase the User Attribute value field length (JasperReports Server 5.0.1)


    akonkin
    • Features: JasperReports Server Version: v5.0.1 Product: JasperReports® Server

    Profile attributes may be useful if you need to the add additional level of security to your data.

    Below I quote a short description of this feature from JasperReports Server User Guide -> Advanced Domain Features -> The DomEL Syntax -> Profile Attributes :

    'A profile attribute is a name-value pair inserted in a user object, such as a user or role. It is ordinarily used to extend the object’s standard access grants, but it has other uses, as well. It can be added to objects by database tools or custom code'

    The field length of this attribute in JasperReports Server Repository and JasperReports Server user interface is restricted to 255 characters. Some of the solutions require the length of this field that is longer then the length that is adjusted by default.

    To increase the length of the Profile Attribute field three steps should be done (JasperReports Server v5.0.1):

    1. The length of this field should be increased in the JasperReports Server Repository
    2. The length of this field should be increased in <jasperserver-pro>WEB-INFapplicationContext-rest-services.xml
    3. The length of this field should be increased in <jasperserver-pro>scriptsattributes.model.js

    Below I provide the detailed description that shows how to do this:

    1. I use PostgreSQL as the JasperReports Repository. The value related to the Profile Attribute field is stored in jiprofileattribute table and is named attrvalue.

      Plese refer to the screenshot below on which is shown sequense of commands that was used to increase the length of the attrvalue field.

      postgre_sql_alter_column.png.be025cc362998dfcaea9017a44b9f427.png
    2. Open the file, <jasperserver-pro>WEB-INFapplicationContext-rest-services.xml, and change the numeric value according to the changes that were done in the jiprofileattribute table

      <property name="maxLengthAttrValue">
          <value type="int">7000</value>
      </property>

    3. Open the file, <jasperserver-pro>scriptsattributes.model.js, and change the value MAX_LENGTH_OF_VALUE to the value that you want.

      exports.settings = {
          MAX_LENGTH_OF_NAME: 255,
          MAX_LENGTH_OF_VALUE: 7000
      }

    To apply the changes that have been done the application server should be restarted.

    Thank you for your attention to this article.

    Alex

    postgre_sql_alter_column.png.4e51b0f7dafd411e5b94680a96c09f0f.png


    User Feedback

    Recommended Comments

    In 7.2, the changes are not in the same files. See below files that should be modified :

    1. The length of this field should be increased in the JasperReports Server Repository
    2. The length of this field should be increased in <jasperserver-pro>WEB-INFapplicationContext-remote-services.xml
    3. The length of this field should be increased in <jasperserver-pro>scriptsruntime_dependenciesjrs-uisrcattributesenumvalidationRulesEnum.js
    Link to comment
    Share on other sites



    Guest
    This is now closed for further comments

×
×
  • Create New...