Marvin kakuru

Marvin kakuru

  • 1.4k
  • 355
  • 160.1k

crystal reports with password

Jan 16 2013 6:42 AM

Hi all,

I am trying to view my  "CrystalReport4.rpt" and below is the code im am using and it has been working. However when i added a password to my access database, when I try to generate a report, I am requested for a password and even when I try to login, the small interface says "failed to login". I need a solution within my code using the password to be able to access my access database.

Below is the code I am using..

          {

              crystalReportViewer4.Visible = true;

                ReportDocument cryRpt = new ReportDocument();

                cryRpt.Load("C:/Users/katoto/Documents/Visual Studio 2010/Projects/Genesis Philcollins/Genesis Philcollins/CrystalReport4.rpt");

                ParameterFieldDefinitions crParameterFieldDefinitions;

                ParameterFieldDefinition crParameterFieldDefinition;

                ParameterValues crParameterValues = new ParameterValues();

                ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();


                crParameterDiscreteValue.Value = textBox2.Text;

                crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;

                crParameterFieldDefinition = crParameterFieldDefinitions["bankacid"];

                crParameterValues = crParameterFieldDefinition.CurrentValues;

 

                crParameterValues.Clear();

                crParameterValues.Add(crParameterDiscreteValue);

                crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);

 

                crystalReportViewer4.ReportSource = cryRpt;

                crystalReportViewer4.Refresh();          

            }

Thanks again and Best Regards.


Answers (10)