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.ReportFooterstence1.reportObjects ["Subreport1"] As subreportObject; ReportDocument Osub1 = OsubReport1.OpensUBReport ("Inspection");
Osub1.SetDataSource (Dataset);
SubreportObject Osubreport2 = ORPT.ReportOoterSection2.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"); oSub3.SetDataSource (dataSet);
ORPT.SETDATASOURCE (DataSet);
Oviewer.Reportsource = ORPT; ORPT has three characters, and Dataset has three tables. By accessing each word report, the code is entered by accessing each word.