Datasource won't hide

Stimulsoft Reports.WEB discussion
Post Reply
Brix
Posts: 14
Joined: Wed Jul 07, 2010 7:10 am
Location: Utrecht

Datasource won't hide

Post by Brix »

Hi,

I added a datasource through the code. But I don't want users to see it because of the username and password in it.

The code:

report.Dictionary.Databases.Add(new StiSqlDatabase("DataWarehouse", ConfigurationManager.ConnectionStrings["DataWarehouse"].ToString()));
report.Dictionary.Restrictions.Add("DataWarehouse", StiDataType.DataSource, StiRestrictionTypes.DenyShow);


The Datasource still remains visible after doing this. Even when I try DenyEdit, and then try to edit the Datasource connection string, i'm still able to edit.
I'm wondering if the String name of Restrictions.Add() is correct.

Please advise

Thank you
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Datasource won't hide

Post by Jan »

Hello,

You should replace StiDataType.DataSource by StiDataType.Database because you want hide database reference (not data source).

Thank you.
Brix
Posts: 14
Joined: Wed Jul 07, 2010 7:10 am
Location: Utrecht

Datasource won't hide

Post by Brix »

Hello,

I did like you said. However, what I am trying to accomplish is that the users cannot see or edit the connection string.
At this time, seeing and editing is possible when the datasource is visible.

Thank you
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Datasource won't hide

Post by Jan »

Hello Brix,

You have used web designer? In this case you need use static property - Stimulsoft.Report.Web.StiWebDesignerOptions.ModifyConnections.

Thank you.
Brix
Posts: 14
Joined: Wed Jul 07, 2010 7:10 am
Location: Utrecht

Datasource won't hide

Post by Brix »

Hello Jan,

This worked beautifully.

Thanks!!
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Datasource won't hide

Post by Andrew »

Hello,

This is very nice - our advice works for you!

Thank you.
Post Reply