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.Substring(settings.IndexOf('=') + 1);
_username = settings.Substring(settings.IndexOf('=') + 1);
_password = settings.Substring(settings.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?