In my report i have two tables(Table1 and Table2).Table1 shows the values from scoreTbl(Database table) and the Table2 shows value form resultTbl. Both Table has one unique column as ID.Im showing score as well as the final result in the same report. To show score table, i added datasource as usual and displayng values.
And then for Table2, i pulled the data from Datsource->resultTbl.And put it in the column of Table. When i run the report it doesnt show anyhting. For that i created new Dataset as Dataset2 which has resukttbl in that. Now i want to know how to add two datasource in a single report. I added one datasource as
String sQuery = "SELECT * FROM scoretbl WHERE (SessionID='" + Sessionstr + "')";
MySqlDataAdapter ada = new MySqlDataAdapter(sQuery, Properties.Settings.Default.DBPerfScoreConnectionString);
DataSet ds = new DataSet();
ada.Fill(ds);
ReportDataSource reportDataSource2 = new ReportDataSource();
reportDataSource2.Name = "DBPerfScoreDataSet_perfscoretbl";
reportDataSource2.Value = ds.Tables[0];
this.reportViewer1.LocalReport.DataSources.Add(reportDataSource2);
Aucun commentaire:
Enregistrer un commentaire