Page 1 of 1

Datasource won't hide

Posted: Fri Jul 09, 2010 8:13 am
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

Datasource won't hide

Posted: Sun Jul 11, 2010 10:33 am
by Jan
Hello,

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

Thank you.

Datasource won't hide

Posted: Mon Jul 12, 2010 3:34 am
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

Datasource won't hide

Posted: Mon Jul 12, 2010 6:53 am
by Jan
Hello Brix,

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

Thank you.

Datasource won't hide

Posted: Tue Jul 13, 2010 7:27 am
by Brix
Hello Jan,

This worked beautifully.

Thanks!!

Datasource won't hide

Posted: Tue Jul 13, 2010 7:43 am
by Andrew
Hello,

This is very nice - our advice works for you!

Thank you.