Community
Showing results for 
Search instead for 
Do you mean 
Reply

get password for crystal report

Copper Contributor
Posts: 11
Country: Netherlands

get password for crystal report

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 Smiley Wink

 

 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?

Nickel Super Contributor
Posts: 441
Country: UK

Re: get password for crystal report

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

Copper Contributor
Posts: 11
Country: Netherlands

Re: get password for crystal report

Thx, I was already doing that now but I wanted a more user-friendly approachSmiley Happy