10-21-2009 02:38 AM
I created a plugin for Act. It adds several reports created in Crystal Reports. The problem is that each report has my connection settings (path,username,password) etc. I want to fetch the settings from Act itself.
First I used the registry but just found out that you can use application.ActFramework.CurrentACTOLEDB
what I do now:
String oledbstring = _application.ActFramework.CurrentACTOLEDB;
String[] settings = oledbstring.Split(';');
if (settings.Length > 3)
{
_dbpath = settings[1].Substring(settings[1].IndexOf('=') + 1);
_username = settings[2].Substring(settings[2].IndexOf('=') + 1);
_password = settings[3].Substring(settings[3].IndexOf('=') + 1);
int pos = _dbpath.LastIndexOf('\\');
_dbname = _dbpath.Substring(pos + 1, _dbpath.Length - pos - 5);
}
Now I got the info but I can't use it (the password) for the ReportClass object.
_reportclass.SetDatabaseLogon(_username, _password, _dbpath, _dbname);
It prompts me for the password. It it possible to decrypt the password for Crystal Reports or do I just have to use another function?
10-21-2009 06:24 AM
Only way I have found of doing it is to have a box prompt you for the password right before you launch the report.
Tom
10-21-2009 06:33 AM