Jump to content
We've recently updated our Privacy Statement, available here ×

How to use Attributes for dynamic data source ?


yann22580

Recommended Posts

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

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

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

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...