Has it been plagued by data binding issues in subreports of Crystal Reports? This is also a question I mentioned in another article.
Http://www.cnblogs.com/haozidong/archive/2004/10/20/54489.html
You can bind a subreport with code to solve this problem.
String sconnectionstring = configurationsettings. receivettings ["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 subreportobject;
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 ");
Osub3.setdatasource (Dataset );
Orpt. setdatasource (Dataset );
Oviewer. reportsource = orpt;
Orpt has three word reports and dataset has three tables.
The preceding Code accesses each word report to bind data to subreports.