Hey guys!

I have managed to fix a previous problem but now I have a new one!The "Details" fields keeps repeating itself for example its showing it 4 times instead of one!this is my code

Dim crptdoc As New CrystalReport1
        Dim mystr As String
        Dim myDS As New DataSet1

        crptdoc.Load("C:\Users\ACP\Documents\Visual Studio 2005\Projects\Sistema ManoObras\SistemaManoObras\SistemaManoObras")
        crptdoc.SetDataSource(myDS.Tables("Payroll"))

        mystr = "{Employees.EmployeeID} = " & Val(Form1.TxtEmpID.Text) & "and {Payroll.PayrollID} = " & Val(Form1.TxtPayrollID.Text) & ""
       
 CrystalReportViewer1.SelectionFormula = mystr
        CrystalReportViewer1.ReportSource = crptdoc

What am I doing wrong?

try to group the field that shows 4 times instead of one... right click the report then report>group expert then select the field you want to show once...

try to group the field that shows 4 times instead of one... right click the report then report>group expert then select the field you want to show once...

I tried it and its still repeating the data!I tried grouping it by reference number which is a unique field and still does it!any other suggestions?!

Your query string doesn't contain any selection criteria to limit the records pulled. If the person has 4 records in the payroll file, then you will get 4 repeats in the details. Try adding a filter such as "where date = 2/21/12" to your query string.

Your query string doesn't contain any selection criteria to limit the records pulled. If the person has 4 records in the payroll file, then you will get 4 repeats in the details. Try adding a filter such as "where date = 2/21/12" to your query string.

How do I apply the filter?I tried doing it and dint work!

please first provide your query which you are using in your report . then we can help you in a better way. with out knowing the reason nobody can provide a solution.
Regards

please first provide your query which you are using in your report . then we can help you in a better way. with out knowing the reason nobody can provide a solution.
Regards

The previous code I posted is the only I'm working!don't know if it helps but that's all I had working for me!

This article has been dead for over six months. Start a new discussion instead.