yesterday they helped me with a problem that I have and I had managed to solve it, but I have a more serious one derived from it ... I have a local connection odbc (mysql) configured to work with crystal report, I have to use a query with inner because I have to show data from several tables but when I launch the generate button, the execution is closed, but it does not mark me any error, apart from the fact that it does not take the parameter ... I have this code:
Public Sub generarInformeIncidencia()
Dim MyConnection As New OdbcConnection(MyConString)
Dim frm As New frmPrincipal
Try
Dim MyCommand As New OdbcCommand()
Dim MyDataReader As OdbcDataReader
' Dim valor As MySqlDataReader
MyConnection.Open()
Dim tablas As New DataTable
Dim reporte As New InformeFinalIncidencia1
MyCommand.CommandText = ("SELECT inc.id_incidencia, tipo.identificacion_solicitud, inc.fecha_registro, niv.identificacion_nivel, est.identificacion_estado, met.identificacion_metodo, fun.nombre_funcionario, cat.identificacion_categoria, scat.identificacion_subcategoria, inc.detalle_incidencia, sop.nombre_funcionario FROM tbl_incidencias inc LEFT JOIN tbl_metodos_ingreso_incidencia met ON inc.id_metodo_ingreso=met.id_metodo_ingreso LEFT JOIN tbl_funcionario fun ON inc.id_registro=fun.id_registro LEFT JOIN tbl_funcionario_soporte sop ON inc.id_registro_soporte=sop.id_registro_soporte LEFT JOIN tbl_tipo_solicitud tipo ON inc.id_tipo_solicitud=tipo.id_tipo_solicitud LEFT JOIN tbl_categoria_incidencia cat ON inc.id_categoria=cat.id_categoria LEFT JOIN tbl_subcategoria_incidencia scat ON inc.id_subcategoria=scat.id_subcategoria LEFT JOIN tbl_niveles_incidencia niv ON inc.id_nivel=niv.id_nivel LEFT JOIN tbl_estados_incidencia est ON inc.id_estado=est.id_estado WHERE inc.id_incidencia=id_incidencia")
MyDataReader = MyCommand.ExecuteReader
tablas.Load(MyDataReader)
InformeFinalIncidencia1.SetParameterValue("id_incidencia", txtId.Text)
visorIncidencia.ReportSource = InformeFinalIncidencia1
visorIncidencia.Show()
MyConnection.Close()
Catch MyOdbcException As OdbcException
Dim i As Integer
MsgBox(MyOdbcException.ToString)
'Catch program exception
Catch MyException As Exception
MsgBox(MyException.ToString)
End Try
'Me.dgIncidenciasAsignadas.Refresh()
End Sub
and to this function I call it from a button that should generate the report in cun crystalreportviewer of the same form ...
I thank you for the help already, if it were not that I am too complicated I would not be bothering you again