0

guys, i need help on passing multiple values in a parameter field in crystal report viewer, I already set it to allow multiple values. When the code below executed it only displays the last record and not all of the records that appeared. here's my code. hope you help me here guys. I really need this one!

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        dt = New DataTable
        sda = New SqlDataAdapter("SELECT * FROM KEMPMASTER", sqlcon)
        sda.Fill(dt)
        If dt.Rows.Count <> 0 Then
            dg.DataSource = dt
            dg.Enabled = True
            btnView.Enabled = True
            GroupBox1.Visible = False
        Else
            MsgBox("No record found!", MsgBoxStyle.Exclamation, "No Record")
        End If
    End Sub
----------------------------------------------------------------------------

Private Sub btnView_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnView.Click
        Dim reports As New frmReports
        Dim objrep As New crysEmployee
        Dim empid(dt.Rows.Count - 1) As String

        While total <> dt.Rows.Count
            empid(total) = dt.Rows(total).Item(0)
            objrep.SetParameterValue("EMPL_ID", empid(total))
            objrep.SetParameterValue("EMPL_LNAME", dt.Rows(total).Item(5))
            objrep.SetParameterValue("EMPL_FNAME", dt.Rows(total).Item(6))
            objrep.SetParameterValue("EMPL_MNAME", dt.Rows(total).Item(7))

            frmReports.crv.ReportSource = objrep
            total += 1
        End While
        frmReports.Show()

    End Sub
3
Contributors
2
Replies
13
Views
6 Years
Discussion Span
Last Post by mankuji
0

I have a code source using crystal report in visual studio 2008.
I want to display my report with all the values of parameters which have multiple values.
It displays only the first value instead of many values. I use 2 parameters : periode de paie, matricule. I have problems about the second parameter for displaying all the matricules in my report. A part of my codes is below:
for full implementation refer here: <a href="http://www.mindstick.com/blog/667/How%20to%20pass%20parameters%20with%20multiples%20values%20in%20crystal%20report" target="_blank">pass parameters with multiples values in crystal report</a>

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.