【发布时间】:2015-10-20 05:35:42
【问题描述】:
我正在尝试在 Crystal Reports 中创建报表,但是当我将参数分配给报表时,它不显示选择查询的结果。它显示了表的所有列,尽管选择查询的结果是正确的。这是我的代码:
Dim ulogueado, consulta As String
consulta = "select nombre from usuario where usuario = @user"
Dim lector1 As MySqlDataReader
Dim comando As New MySqlCommand(consulta, conector)
comando.Parameters.AddWithValue("@user", usuario_conectado)
Try
lector1 = comando.ExecuteReader()
If lector1.Read Then
ulogueado = lector1.GetString(0)
End If
Dim reporte1 As New CrystalReport3
reporte1.SetDataSource(lector1.GetString(0))
reportes1.CrystalReportViewer1.ReportSource = reporte1
reportes1.CrystalReportViewer1.RefreshReport()
Catch ex As Exception
End Try
reportes1.Show()
我几乎可以肯定问题可能出在 SetDataSource 行,但我不知道我还能做什么。感谢您对此问题的所有关注和合作。
【问题讨论】:
标签: mysql vb.net crystal-reports