Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.

Welcome Guest ! To enable all features please Login or Register.



Go to last post Go to first unread
#1 Posted : Friday, April 22, 2022 12:25:43 PM(UTC)

Rank: Newbie

Groups: Registered
Joined: 4/22/2022(UTC)
Posts: 1

We are developing web application, every organization will have different sql database under single sqlserver and each database have same schema.

Also there is one more database with name TenantConfigs that contains details of organization and its database configuration with some master level data.

Can you please help for my below doubts.

1. We need to create same report for all organization but its database connection will be different for every organization.

- is it possible to change database connection from code?

2. Each organization have different users and their role.

- is it possible to add filter on user login and as per their role?

3. While create data source and model we need to add join with our TenantConfigs database. As of now i try to create model in report designer but its only allow me to select one database at a time.

- is it possible to create one data source with multiple database and its tables.

4. We have angular/react as frontend and .net5 api as backend.

- is there anyway to bind report in angular using apis response ?

Thanks in Advance.
#2 Posted : Tuesday, April 26, 2022 7:38:12 AM(UTC)

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Actually you can do what you want if you master the model and code some c# in related scripts.
You can use the 'Custom Security Script' (Server Manager -> Configuration -> Configure Web Security...) to initialize your user setting and repository.
According to the user logged, you may:
Change connection string from the Repository data sources.
Add/Remove rights to the user.
Add dynamic filters to tables for the users.

You may also use the 'Report Execution Init Script' (Server Manager -> Configuration -> Configure Server...) to change dynamically execution behavior.

Here are some samples for 'Custom Security Script':
Change the connection string:
		if (user.BelongsToGroup("A_GROUP"))
			foreach (var source in user.Security.Repository.Sources)
				source.Connection.MSSqlServerConnectionString += ";Column Encryption Setting=enabled;";
				foreach (var connection in source.Connections.Where(i => !string.IsNullOrEmpty(i.MSSqlServerConnectionString)))
					connection.MSSqlServerConnectionString += ";Column Encryption Setting=enabled;";

Add dynamic security:
				var metaTable = source.MetaData.Tables.FirstOrDefault(i => i.Name.ToLower() == "a_table_name");
				if (metaTable != null)
					metaTable.WhereSQL = //TODO using metaTable.Name, Helper.QuoteSingle(user.Name)

For point 3:
You may use a LINQ Data Source, then add 'Table Links' to 1 or other database sources, this allows to perform JOINS at client side using LINQ.

For point 4:
No experience with angular bit you should check seal interface (https://sealreport.org/demo/WebInterfaceAPI.html) to use pure JS from your browser.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.