Data Binding Problems of Crystal Reports Binds Select from Haozidong BLOG

xiaoxiao2021-03-06  73

Is it tortured by the data binding problem of the report in the crystal report? This is also what I said in another article http://www.cnblogs.com/haozidong/archive/2004/10/54489.html You can solve this problem by tie the stator report separately.

string sConnectionString = ConfigurationSettings.AppSettings [ "dbCommISMS"]; SqlConnection sqlConn = new SqlConnection (sConnectionString); SqlCommand sqlComm = new SqlCommand (); SqlDataAdapter dataAdapter = new SqlDataAdapter (); sqlConn.Open (); sqlComm.Connection = sqlConn; sqlComm .CommandType = CommandType.Text; dataAdapter.SelectCommand = sqlComm; Dataset1 dataSet = new Dataset1 (); string sSQL = "SELECT * FROM T_REQUEST WHERE aPPLI_ID = '" appli_id "'"; sqlComm.CommandText = sSQL; dataAdapter.Fill (dataSet, "T_REQUEST"); sSQL = "SELECT * FROM T_REQUEST_INSPECTION WHERE aPPLI_ID = '" appli_id "'"; sqlComm.CommandText = sSQL; dataAdapter.Fill (dataSet, "T_REQUEST_INSPECTION"); sSQL = "SELECT * FROM T_ACCEPT_INSPECTION WHERE aPPLI_ID = ' " appli_id "' "; sqlComm.CommandText = sSQL; dataAdapter.Fill (dataSet," T_ACCEPT_INSPECTION "); SubreportObject oSubreport1 = oRpt.ReportFooterSection1.ReportObjects [" Subreport1 "] as SubreportObjec t; ReportDocument oSub1 = oSubreport1.OpenSubreport ( "Inspection"); oSub1.SetDataSource (dataSet); SubreportObject oSubreport2 = oRpt.ReportFooterSection2.ReportObjects [ "Subreport2"] as SubreportObject; ReportDocument oSub2 = oSubreport1.OpenSubreport ( "Survey"); oSub2 .SetDataSource (dataSet); SubreportObject oSubreport3 = oRpt.ReportFooterSection2.ReportObjects [ "Subreport3"] as SubreportObject; ReportDocument oSub3 = oSubreport1.OpenSubreport ( "Allonge");

转载请注明原文地址:https://www.9cbs.com/read-93812.html

New Post(0)