Does anyone see why the report in this code would use the datasource that was used when it was created instead of the dataset that it is told to use?
Code:Dim da As New OleDbDataAdapter("SELECT tblAbsenteeism.AssociateID, tblAbsenteeism.AssociatesName, tblAbsenteeism.DepartmentName, tblAbsenteeism.ReasonCode, tblAbsenteeism.OccurrenceDate, tblAbsenteeism.Points, tblAssociateInformationList.Active FROM tblAbsenteeism INNER JOIN tblAssociateInformationList ON tblAbsenteeism.AssociateID = tblAssociateInformationList.AssociateID WHERE tblAssociateInformationList.Active = ?", cn) Dim ds As New DataSet da.SelectCommand.Parameters.Add("@Active", OleDbType.Boolean).Value = True da.FillSchema(ds, SchemaType.Source, "tblAbsenteeism") da.Fill(ds) Dim cr As New AbsDaysPerDeptGreaterThanSix cr.SetDataSource(ds.Tables("tblAbsenteeism")) CrystalReportViewer1.ReportSource = cr (Rate)




Reply With Quote