Hello,
I wrote an application which reads data out of a MSSQL database and display these in Textboxes. Now I want to print it and guess the easiest way is with creating a report.
This is a part of my code to display the values:
But how can I send the textboxes to a report? I am getting crazy with that or do I do so bad?
Here is a pic how my app "looks"
Hope someone can me help out of this
I wrote an application which reads data out of a MSSQL database and display these in Textboxes. Now I want to print it and guess the easiest way is with creating a report.
This is a part of my code to display the values:
VB.NET:
Private Sub ComboBox_NumModificacion_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox_NumModificacion.SelectedIndexChanged
On Error Resume Next
Dim sqlConn As New SqlConnection("server=srvmti;database=SHF;Integrated Security=True")
sqlConn.Open()
Dim sqlComm As New SqlCommand("SELECT IdGama,NombreGama,NumModificacion,DescModificacion,Activa,Proyecto,IdCarro,IdMaquina,Fecha,tRegAuto,ControlPotencia,PotenciaSold,RetardoInicio,TiempoSold,TiempoEnfr,TiempoSubida,PosicionInicial,CorrienteSoldadura,PresionSoldadura,PresionEnfriamiento,TempPiovan,PosicionPrensa,NumMoldes,Utillaje,Portapiezas,Plancha,Observaciones FROM Gamas where IdGama=" & ComboBox_IDGama.Text & " and NumModificacion=" & ComboBox_NumModificacion.Text, sqlConn)
Dim r As SqlDataReader = sqlComm.ExecuteReader()
While r.Read()
Dim NombreGama As String = CStr(r("NombreGama"))
TextBox_NombreGama.Text = NombreGama
Dim NumModificacion As String = CStr(r("NumModificacion"))
If ComboBox_NumModificacion.Items.IndexOf(NumModificacion) = True Then
ComboBox_NumModificacion.Items.Add(NumModificacion)
End If
Dim DescModificacion As String = CStr(r("DescModificacion"))
TextBox_DescModificacion.Text = DescModificacion
Dim Activa As String = CStr(r("Activa"))
CheckBox_Activa.CheckState = Activa
Dim Carro As Integer = CStr(r("IdCarro"))
If Carro = "0" Then
ComboBox_IdCarro.Text = "Carro inferior"
End If
If Carro = "1" Then
ComboBox_IdCarro.Text = "Carro superior"
End If
End While
r.Close()
sqlConn.Close()
End Sub
But how can I send the textboxes to a report? I am getting crazy with that or do I do so bad?
Here is a pic how my app "looks"
Hope someone can me help out of this