PSC Crystal Reports with VB.NET Windows Forms. Knowing that the name of the report is impempresas.rpt is this file
in this directory:

c:\test\report\impempresas.rpt
how do I enter information for printing the report in the code below:

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions.ReportSource

Dim conexaodb As String = “User ID=System;Password=fernanda;Data
Source=ORCL;”
Dim conexao As OracleConnection = New OracleConnection()
Dim cmd As OracleCommand = New OracleCommand()
Dim dr As OracleDataReader
conexao.ConnectionString = conexaodb
Try
conexao.Open()
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
Try
cmd.Connection = conexao
With cmd
.CommandText = “BUSCA_POR_CEP”
.CommandType = CommandType.StoredProcedure
.Parameters.Add(“CEP_ID”, NVarChar, 8).Value = “09811222”
.Parameters(0).Direction = ParameterDirection.Input
.Parameters.Add(“EMPRESAS_C”, OracleType.Cursor)
.Parameters(1).Direction = ParameterDirection.Output
End With
Try
dr = cmd.ExecuteReader()
While (dr.Read())
TextBox1.Text = dr.GetOracleNumber(0)
TextBox2.Text = dr.GetOracleString(1)
TextBox3.Text = dr.GetOracleString(2)
TextBox4.Text = dr.GetOracleString(3)
TextBox5.Text = “Completado com sucesso”
End While
dr.Close()
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
cmd.Dispose()
conexao.Close()
conexao.Dispose()

🔥68 Views

Anu

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.