Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Database Login print with Crystal Reports VB.NET Post Reply Post New Topic
Author Message
claudinei
Newbie
Newbie
Avatar

Joined: 03 Dec 2008
Location: Brazil
Online Status: Offline
Posts: 3
Quote claudinei Replybullet Topic: Database Login print with Crystal Reports VB.NET
    Posted: 03 Dec 2008 at 7:10pm

Staff

    Good night, based on the code below am the following issues:

1) The opening screen of the database login, password to verify the claims that must be done?
2) And how should I do to refresh when the user presses, he update the report?

Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim frm As New Form2
        frm.Show()
    End Sub
End Class

Public Class Form2
    Private Sub crptempresas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles crptempresas.Load
        Dim dbstrconexao As String = "User ID=system;Password=fernanda;Data Source=ORCL;"
        Dim dbcnnconexao As New OracleConnection
        Dim dbcmdconexao As New OracleCommand
        Dim dbdstconexao As New DataSet
        Dim telarpt As New relempresascrp
        dbcnnconexao.ConnectionString = dbstrconexao
        Try
            dbcnnconexao.Open()
        Catch ex As Exception
            MessageBox.Show(ex.Message, " Erro 1 ", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
        Try
            dbcmdconexao.Connection = dbcnnconexao
            With dbcmdconexao
                .CommandText = "BUSCAPORCEP"
                .CommandType = CommandType.StoredProcedure
                .Parameters.Add("CEP_ID", OracleType.NVarChar, 8).Value = Form1.TextBox1.Text.ToString
                .Parameters(0).Direction = ParameterDirection.Input
                .Parameters.Add("EMPRESAS_C", OracleType.Cursor)
                .Parameters(1).Direction = ParameterDirection.Output
            End With
            Try
                Dim dbadpconexao As New OracleDataAdapter(dbcmdconexao)
                dbadpconexao.Fill(dbdstconexao)
                telarpt.SetDataSource(dbdstconexao.Tables(0))
                crptempresas.ReportSource = telarpt
            Catch ex As Exception
                MessageBox.Show(ex.Message, " Erro 2 ", MessageBoxButtons.OK, MessageBoxIcon.Error)
            End Try
        Catch ex As Exception
            Console.WriteLine(ex.Message)
        End Try
        dbcmdconexao.Dispose()
        dbcnnconexao.Close()
        dbcnnconexao.Dispose()
    End Sub
End Class

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.