Results 1 to 8 of 8

Thread: Crystal Report ask for logon info

Hybrid View

  1. #1
    New Member
    Join Date
    Sep 2007
    Posts
    4

    Re: Crystal Report ask for logon info

    Use this code to load the report...
    Code:
    Try
                Dim crtableLogoninfos As New TableLogOnInfos()
                Dim crtableLogoninfo As New TableLogOnInfo()
                Dim crConnectionInfo As New ConnectionInfo()
                Dim CrTables As Tables
                Dim CrTable As Table
                Dim crReportDocument As New G1()
                With crConnectionInfo
                    .DatabaseName = Application.StartupPath & "\db.mdb"
                    .Password = "ps1"
                End With
                CrTables = crReportDocument.Database.Tables
                For Each CrTable In CrTables
                    crtableLogoninfo = CrTable.LogOnInfo
                    crtableLogoninfo.ConnectionInfo = crConnectionInfo
                    CrTable.ApplyLogOnInfo(crtableLogoninfo)
                Next
    
                CRV.ReportSource = crReportDocument
    
            Catch ex As Exception
                MsgBox(ex.Message)
                Me.Cursor = Cursors.Default
            End Try
    Note:
    1- Don't forget to import the labraries
    Code:
    Imports CrystalDecisions.Shared
    Imports CrystalDecisions.CrystalReports.Engine
    2- G1 = the report document you create within Visual Studio
    3- db.mdb = your database filename
    4- ps1 = databse password
    5- CRV = CrystalReportViewer control you add to the form

  2. #2

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    2

    Re: Crystal Report ask for logon info

    Thank you for youre respomd. It really helps me in this situation. My problem is solved!. Thank you very much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width