Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have write the following code but not works.it display an error like load report failed .please rectify my error
var connectionString = ConfigurationManager.ConnectionStrings["smssms"].ConnectionString;
SqlConnection cn = new SqlConnection(connectionString);

string sql = "select * from entryform ";

// SqlConnection connection = new SqlConnection(connectionString);
cn.Open();
SqlCommand sCommand = new SqlCommand(sql, cn);
SqlDataAdapter sda = new SqlDataAdapter(sCommand);
SqlCommandBuilder sBuilder = new SqlCommandBuilder(sda);
DataSet sDs = new DataSet();
sda.Fill(sDs, "smssms");
DataTable dt = sDs.Tables["smssms"];
ReportDocument cryRpt = new ReportDocument();
// cryRpt.Load("C:\\Users\\user\\Documents\\Visual Studio 2010\\Projects\\cryconnection\\cryconnection\\CrystalReport1.rpt");
string _cReportPath = string.Format("{0}\\Reports\\{1}", Application.StartupPath, "CrystalReport1.rpt");
// cryRpt.Load(Application.StartupPath + "CrystalReport1.rpt");
cryRpt.Load(_cReportPath );
crystalReportViewer1.ReportSource = cryRpt;
// crystalReportViewer1.LogOnInfo[0].ConnectionInfo.IntegratedSecurity = true;
crystalReportViewer1.Refresh();
cn.Close();
Posted

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