Link to home
Start Free TrialLog in
Avatar of ebolek
ebolek

asked on

Integrated Security RunTime Customization Crystal10 .NET

Hello friends,

I have  a problem that I have been trying to solve for couple days now.

I have reports that connect to SQL Server and use stored procedures
These reports are designed in Crystal 10 and using OLE DB datasource and stored procs
they all have integrated security embedded.

What I want to do is change the database and server name of the report and still use integrated security in runtime. I know how to chnage the servername and password for reports that have been designed with sql authentication but integrated security chnages things little bit

Thanx for your help

Regards
Emre
Avatar of Mike McCracken
Mike McCracken

Integrated security uses the Windows groups.  You need to ensure the same groups are assigned to the databases or the users are included in a group and the groups have the same permissions in the database.

We changed to a new server and the reports and code needed no changes for users to use them.

mlmcc
Avatar of ebolek

ASKER

I think I didnt explain myself good.

I have to change the database name runtime for a report that uses integrated security.

My code is as follows
private void setlogoninfo_IntegratedSecurity(CrystalDecisions.CrystalReports.Engine.ReportDocument myreport)
 CrystalDecisions.Shared.TableLogOnInfo MyLogonInfo;
foreach(CrystalDecisions.CrystalReports.Engine.Table MyTable in myreport.Database.Tables)
{
                        
MyLogonInfo = MyTable.LogOnInfo;
if (MyTable.Name == "")
{
MyLogonInfo.ConnectionInfo.ServerName  = this._servername;  
MyLogonInfo.ConnectionInfo.DatabaseName = this._databasename ;
                  
}
else
{
MyLogonInfo.ConnectionInfo.ServerName  = this._servername; MyLogonInfo.ConnectionInfo.DatabaseName = this._databasename ;
MyLogonInfo.ConnectionInfo.UserID = "";
MyLogonInfo.ConnectionInfo.Password  = "";      
                              
                              
}
MyTable.ApplyLogOnInfo(MyLogonInfo);                        
MyTable.Location = MyTable.Location.Substring(MyTable.Location.LastIndexOf(".")+1);  
                        
}
}            

In the sql authentication when you chnage the database and server nmae with the code above, it works
In the integrated security what do i set the user id and password too. in other words, do they stay "". If I set userid and password to null, .net doesnt like it. Is there a way to set the type of security in .net during runtime.
If you need more explanation, let me know
Thansk
Emre
INtegrated security shouldn't need a userid and password since it uses the Win logon credentials for database access.  Have you tried using "" for the userid and password?

We only have the one database so there is never a need to change so I haven't worked on that code.

mlmcc
Avatar of ebolek

ASKER

I did try that. I get authorization error from the sql provider when I do that. I have to do it, because we have a test database thatw e can logon that is on different server and boss wants nt authentication for all the modules that we use. I checked everyplace but couldnt find any example of it.

Regards
Emre
How many users will run the reports?

Iask because I am thinking you may be able to do this with the ALIAS or SET LOCATION methods but they may require the royalty runtime license.

mlmcc
Avatar of ebolek

ASKER

Many users: 100 at least

We are goign to be using rystal 10 Developer edition. I have built most of the reports and i hope that is not the case. This is  very important that we do this. i know that if i declare my data sources as datasets I can do it but I dont want all my report datasources to be datasets. that is bad I think. I dont know mlmcc, what do you think. i am stuck
Regards
Emre
Avatar of ebolek

ASKER

I have looked at brian bischof book. And if I use RDC, I think i will have access to the property integrated security for SQL OLEDB. Is this right? I dont want to convert all of the code that I wrote for .net. Seems like runtime customization so far weas enough with .net. RDC is completely new animal and have not used it. What do you think. Do you think it is easy to convert the code to RDC or do i have to?
Avatar of ebolek

ASKER

Did you ever use RDC?
Avatar of ebolek

ASKER

ok after 5 days of looking for it, i found out the problem. The location property should have to be set before applying the changes to the connectioninfo object. It is very strange though. Never mind I am very much relieved for this because it was the biggest obstacle. Thanks again for replies.

Regards
Emre
ASKER CERTIFIED SOLUTION
Avatar of Netminder
Netminder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial