hi all brothers
this code work very well
Dim rpt As New ReportDocument
Dim fileName As String = Server.MapPath("rep1.rpt")
Dim ds As New DataSet
rpt.Load(fileName)
DBCon.Close()
DBCon.Open()
DBadb = New SqlClient.SqlDataAdapter("select o.ahwal_id,o.FullName,o.salary,e.entedabvalue,e.entedabtype,e.adminname,e.workplacetitle from entedabmony e inner join officer_data_entery o on o.ahwal_id=e.ahwal_id where o.ahwal_id=" & AhwalId.Text & "", DBCon)
DBadb.Fill(ds, "entedabmony")
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
but to obtain the same result with following code not give true result
so i ask what the error in the following code
Dim selectFilter As New PredicateExpression
Dim sorter As SortExpression
Dim objRelations As IRelationCollection = New RelationCollection()
objRelations.Add(OfficerDataEnteryEntity.Relations.EntedabMonyEntityUsingAhwalId)
If Not [String].IsNullOrEmpty(ahwalid.Text) Then
selectFilter.AddWithAnd(OfficerDataEnteryFields.AhwalId = AhwalId.Text)
End If
sorter = Nothing
Dim dt As DataTable = EntedabMonyCollection.GetMultiAsDataTable(selectFilter, 0, Nothing, objRelations)
rpt.SetDataSource(dt)
CrystalReportViewer1.ReportSource = rpt
also i tried this code but not also give the true result
Dim selectFilter As New PredicateExpression
Dim fields As New ResultsetFields(3)
fields.DefineField(OfficerDataEnteryFields.AhwalId, 0)
fields.DefineField(EntedabMonyFields.EntedabValue, 1)
'fields.DefineField(OfficerDataEnteryFields.FullNmae, 2)
Dim relations As IRelationCollection = New RelationCollection()
relations.Add(OfficerDataEnteryEntity.Relations.EntedabMonyEntityUsingAhwalId)
If Not [String].IsNullOrEmpty(AhwalId.Text) Then
selectFilter.AddWithAnd(EntedabMonyFields.AhwalId = AhwalId.Text)
End If
Dim dynamicList As New DataTable()
Dim dao As New TypedListDAO()
dao.GetMultiAsDataTable(fields, dynamicList, 0, Nothing, selectFilter, relations, True, Nothing, Nothing, 0, 0)
rpt.SetDataSource(dynamicList)
CrystalReportViewer1.ReportSource = rpt
please help me how can do true results and please don't say return to documentations because all of this from documentation