Print Page | Close Window

Database Login print with Crystal Reports VB.NET

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4924
Printed Date: 03 May 2024 at 11:26pm


Topic: Database Login print with Crystal Reports VB.NET
Posted By: claudinei
Subject: Database Login print with Crystal Reports VB.NET
Date 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




Print Page | Close Window