Solved

crystal reports requests password every time I start application

Posted on 2013-01-26
3
359 Views
Last Modified: 2013-01-26
Hi

I am very new to crystal reports, and I am going to use it in an application I am developing.  It is a c# 2010 winforms application  that connects to an MS Access database which is password protected.

When I go through the process of adding a report (at design time), it requests the password and accepts it.. everything works as expected, I can select a query and produce a report based on that. Great.

But then at runtime, when I click a button I created to display the report, it requests the password again? yikes... why is this not stored in the connection details?  Clearly I don't want the end users to be entering the password for the database...

Any idea how I can prevent this, I don't really want to remove the password from the database.

Cheers

CD
0
Comment
Question by:cycledude
  • 2
3 Comments
 

Accepted Solution

by:
cycledude earned 0 total points
ID: 38821666
I have the solution now:

ReportDocument cryRpt = new ReportDocument();
            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
            ConnectionInfo crConnectionInfo = new ConnectionInfo();
            Tables CrTables;

            cryRpt.Load(PathToReports + "\\CrystalReport1.rpt");


            crConnectionInfo.ServerName = "YOUR SERVER NAME";
            crConnectionInfo.DatabaseName = "YOUR DATABASE NAME";
            crConnectionInfo.UserID = "YOUR USERNAME";
            crConnectionInfo.Password = "YOUR PASSWORD";

            CrTables = cryRpt.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }

            crystalReportViewer1.ReportSource = cryRpt;
            crystalReportViewer1.Refresh(); 

            crystalReportViewer1.ReportSource = cryRpt;
            crystalReportViewer1.Refresh();

Open in new window

0
 

Author Closing Comment

by:cycledude
ID: 38821667
got it easy enough...
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 38822162
For security reasons Crystal doesn't store the password.  If it id all I need is the report file and I can get access to the database.

mlmcc
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now