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
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
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_IntegratedSec urity(Crys talDecisio ns.Crystal Reports.En gine.Repor tDocument myreport)
CrystalDecisions.Shared.Ta bleLogOnIn fo MyLogonInfo;
foreach(CrystalDecisions.C rystalRepo rts.Engine .Table MyTable in myreport.Database.Tables)
{
MyLogonInfo = MyTable.LogOnInfo;
if (MyTable.Name == "")
{
MyLogonInfo.ConnectionInfo .ServerNam e = this._servername;
MyLogonInfo.ConnectionInfo .DatabaseN ame = this._databasename ;
}
else
{
MyLogonInfo.ConnectionInfo .ServerNam e = this._servername; MyLogonInfo.ConnectionInfo .DatabaseN ame = this._databasename ;
MyLogonInfo.ConnectionInfo .UserID = "";
MyLogonInfo.ConnectionInfo .Password = "";
}
MyTable.ApplyLogOnInfo(MyL ogonInfo);
MyTable.Location = MyTable.Location.Substring (MyTable.L ocation.La stIndexOf( ".")+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
I have to change the database name runtime for a report that uses integrated security.
My code is as follows
private void setlogoninfo_IntegratedSec
CrystalDecisions.Shared.Ta
foreach(CrystalDecisions.C
{
MyLogonInfo = MyTable.LogOnInfo;
if (MyTable.Name == "")
{
MyLogonInfo.ConnectionInfo
MyLogonInfo.ConnectionInfo
}
else
{
MyLogonInfo.ConnectionInfo
MyLogonInfo.ConnectionInfo
MyLogonInfo.ConnectionInfo
}
MyTable.ApplyLogOnInfo(MyL
MyTable.Location = MyTable.Location.Substring
}
}
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
We only have the one database so there is never a need to change so I haven't worked on that code.
mlmcc
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
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
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
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
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
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?
ASKER
Did you ever use RDC?
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
Regards
Emre
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
We changed to a new server and the reports and code needed no changes for users to use them.
mlmcc