Asp.net| Crystal Report | problem
One, use view meeting to integrate multiple table associations
II. filtering data through SQL statements
Third, the establishment and the Master-Slave Table Association
Note that when inserting a subreport in the CrystalReport1 table, it is important to set the associated field of the master-slave table, otherwise it will be out of order.
The main code is as follows:
<summary>
Bind Crystalreport
</summary>
<param name= "STRs" >sql</param>
private void Bdreport (String strs)
{
OCR = new CrystalReport1 ();
SqlConnection cnn = new SqlConnection (configurationsettings.appsettings["Connectionsqlserver"));
SqlDataAdapter cmd1 = new SqlDataAdapter (STRS,CNN);
Create and fill the DataSet.
DataSet2 ds = new DataSet2 ();
Cmd1. Fill (DS, "Meeting");
SqlDataAdapter cmd2 = new SqlDataAdapter ("select * from Realplan where Rplanid to" (select top 10000 planid from ("+sqls Tr+ ") as a order by Planid)", CNN);
SqlDataAdapter cmd2 = new SqlDataAdapter (Sqlisoper, CNN);
Cmd2. Fill (ds, "Realplan");
Create the relation between the Authors and Titles tables.
Ds. Relations.Add ("Mo",
Ds. tables["Meeting". columns["Planid"],
Ds. tables["Realplan"]. columns["Rplanid"]);
Binding ReportViewer
Ocr.setdatasource (DS);
This. Crystalreportviewer1.reportsource = OCR;
Close the connection.
Cnn. Close ();
}