Hi,
I followed the Admin guide and tested with a new user on JRS 6.4.0 and JRS 7.5.0 and I get the same error :
"Attribute 'host' is not defined in the User Profile."
Or if the host is defined in the Server profile :
"Attribute 'host' is not defined in the server Profile."
2020-01-21 17:27:10,545 ERROR ProfileAttributesResolverImpl,http-apr-8080-exec-12:307 - Erreur de substitution dans la ressource /datasources/JDBC_PGDH, champ 'url'. Attribut 'host' non défini dans le Server Profile.
Here is the URL : jdbc:postgresql://{attribute('host','Server')}:{attribute('port','Server')}/{attribute('db','Server')}
If anyone has an idea ?
Regards,
Yann
4 Answers:
Here is how you can use Attributes in Data Source definitions: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-administrator-guide/v750/attributes-data-source-definitions
When you do something like "{attribute('host','Server')}" a value for the "host" attribute needs to be in the Server Attributes (Manage > Server Settings > Server Attributes) need to be set.
"{attribute('someKey','User')}" implies a "someKey" needs to be in the User Atributes of the currently logged in user.
"{attribute('someKey')}" implies that the Server will search for a "someKey" attribute in the following order: User (logged in user), Organization hierarchy of logged in user, Server.
Sherman
Thanks to you Sherman but what you explain is exactly what I did. I precised I followed the Admin guide and create a new user for the tests.
I tried with the attributes at the user level or server level, both reacts the same with the error below : " 'host' attribute not defined at User/Server profile".
I attached another screenshot of the user attributes.
Would you have another idea ?
Attachment | Size |
---|---|
![]() | 17.61 KB |
Hi,
in Manage > Server Settings > Server Attributes menu you should add atrbiutes using their name/key, that is just
userName
password
Syntax like {attribute('host','Server')} should be used in Da tasource definition only:
jdbc:postgresql://{attribute('host','Server')}:{attribute('port','Server')}/{attribute('db','Server')}
Best regards,
Andriy