Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am creating a WPF app which is using crystal reports for showing details with ms access Database.
it working fine on my machine but after deploying app on client machine it is asking for user name and password before showing report and i didnt give any credential for database. Below is my code
C#
CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
rpt.Load(AppDomain.CurrentDomain.BaseDirectory + "\\TechReport.rpt");
DataAcessLayer obj = new DataAcessLayer();
Report rptViewer = new Report();
      
DataTable DataTab = new DataTable();
System.Data.OleDb.OleDbDataAdapter dataAdapter = new System.Data.OleDb.OleDbDataAdapter();
System.Data.OleDb.OleDbConnection CON = new System.Data.OleDb.OleDbConnection();
CON.ConnectionString = obj.connectionString;
string[] tablename = new string[5];
string[] querystring = new string[5];
tablename[0] = "TechnicalParameter";
tablename[1] = "StructualPerameter";
tablename[2] = "PerformancePerameter";
tablename[3] = "EconomicParameter";
tablename[4] = "AcceptibilityParameter";
querystring[0] = "Select * From TechnicalParameter where PlantID= " + id + " ";
querystring[1] = "Select * From StructualPerameter where PlantID=" + id + " ";
querystring[2] = "Select * From PerformancePerameter where PlantID=" + id + " "; ;
querystring[3] = "Select * From EconomicParameter where PlantID=" + id + " ";
querystring[4] = "Select * From AcceptibilityParameter where PlantID=" + id + " "; ;
DataSet DataSet = new DataSet();
for (int I = 0; I <= Microsoft.VisualBasic.Information.UBound(tablename); I++)
{
    System.Data.OleDb.OleDbDataAdapter Adapter = new System.Data.OleDb.OleDbDataAdapter();
    Adapter = obj.GetDataAdeptor(querystring[I]);
    Adapter.Fill(DataSet, tablename[I]);
}
              
rpt.SetDataSource(DataSet);
                
rpt.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA4;
               
rptViewer.crytt.ViewerCore.ReportSource = rpt;
rptViewer.Show();

Please tell me how to fix this.
thanx in advance
Posted
Updated 8-Feb-15 3:12am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900