Where the error Here

Posts   
 
    
mahm9
User
Posts: 11
Joined: 10-Mar-2009
# Posted on: 04-Apr-2009 19:21:19   

I faced some problem with crystal report report not make filter on data and return all row

down the code

Dim rpt As New ReportDocument
        Dim fileName As String = Server.MapPath("entdab_dakhli.rpt")
         rpt.Load(fileName)



         'Dim col As New EntedabMonyCollection
        Dim selectFilter As New PredicateExpression
         ' Dim sorter As SortExpression
         Dim ahwalid As New TextBox
         ahwalid.Text = 1
         Dim IPredicateExpression = New PredicateExpression()
         If Not [String].IsNullOrEmpty(ahwalid.Text) Then
             selectFilter.AddWithAnd(EntedabMonyFields.EntedabType = ahwalid.Text)
         End If
         If Not [String].IsNullOrEmpty(TextBox1.Text) Then
             selectFilter.AddWithAnd(EntedabMonyFields.DeputStart >= TextBox1.Text)
         End If
         If Not [String].IsNullOrEmpty(TextBox2.Text) Then
             selectFilter.AddWithAnd(EntedabMonyFields.DeputEnd <= TextBox2.Text)
         End If
        
                Dim ds As New DataSet
        ds.Tables.Clear()


Ds.Tables.Add(LLBLGenProDataSource1.EntityCollection.GetMulti(selectFilter))
         CrystalReportViewer1.ReportSource = rpt
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 05-Apr-2009 10:26:51   

your code has parameters which are equal to our type names, please don't do that: Dim IPredicateExpression = New PredicateExpression()

change the typename of IPredicateExpression

also, place a breakpoint in the code at the GetMulti call and check if the selectFilter indeed is set to a filter, if the predicate expression indeed has predicates. If not, you should step through the code above it with the if statements to see if you add predicates to selectFilter or not.

Frans Bouma | Lead developer LLBLGen Pro