Page 1 of 1

How to restrict user from creating new datasources (dictionary) in Designer and only use available connection

Posted: Tue May 06, 2025 10:16 pm
by muhammadhunainnasir
Hi.

I want to have a predefined MSSQL datasource (from app.settings) connection string to be used for Reports (Viewing and Designing).

How can I add a MSSQL connection string from code behind in .Net 8 Blazor Server application and hide add data source option from designer for users ?

Re: How to restrict user from creating new datasources (dictionary) in Designer and only use available connection

Posted: Wed May 07, 2025 10:45 am
by Max Shamanov
Hello,

You can try to use the following code to create a datasource from the code and add it to the report:

Code: Select all

var sqlDatabase = new StiSqlDatabase("MS SQL Connection", "connectionString");
 report.Dictionary.Databases.Add(sqlDatabase);
And you can use the following code to hide add datasource option:

Code: Select all

private StiBlazorDesignerOptions Options = new StiBlazorDesignerOptions()
    {
          Dictionary = {
            PermissionDataSources = Stimulsoft.Report.Web.StiDesignerPermissions.View
        }

    };

Thank you.

Re: How to restrict user from creating new datasources (dictionary) in Designer and only use available connection

Posted: Thu May 15, 2025 12:51 pm
by muhammadhunainnasir
it is still letting me create new dictionary please see attached. I want to eliminate new dictionary and save as dictionary option to prevent user from creating new dictionaries.

Re: How to restrict user from creating new datasources (dictionary) in Designer and only use available connection

Posted: Fri May 16, 2025 7:05 am
by Max Shamanov
Hello,

We would need more time to get an answer for you.
We will let you know when we get any results.

Thank you.
#17466

Re: How to restrict user from creating new datasources (dictionary) in Designer and only use available connection

Posted: Wed May 21, 2025 2:15 pm
by Max Shamanov
Hello,

Please check the attached sample project.

Thank you.