Results 1 to 3 of 3

Thread: VB 2005 and Cystal reports

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    258

    VB 2005 and Cystal reports

    Hi, im making a crystal report for my program and after setting it up and running it, it then asks me to login to the database where it is getting the data from, what codes should i add in order to skip this login prompt everytime i run the crystal report / form? thanks im using 05.

  2. #2
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: VB 2005 and Cystal reports

    Hi.
    Here's how to avoid login information prompt
    vb Code:
    1. Imports CrystalDecisions.CrystalReports.Engine
    2. Imports CrystalDecisions.Shared
    3.  
    4. Dim crDatabase As Database
    5. Dim crTables As Tables
    6. Dim crTable As Table
    7. Dim crTableLogOnInfo As TableLogOnInfo
    8. Dim crConnectionInfo As ConnectionInfo
    9.  
    10. Dim crReportDocument As New CrystalReports1
    11. crConnectionInfo = New ConnectionInfo
    12. With crConnectionInfo
    13.     .ServerName = "Ares"
    14.     .DatabaseName = "Dinefer"
    15.     .UserID = "bb"
    16.     .Password = "aa"
    17. End With
    18. crDatabase = crReportDocument.Database
    19. crTables = crDatabase.Tables
    20. For Each crTable In crTables
    21.     crTableLogOnInfo = crTable.LogOnInfo
    22.     crTableLogOnInfo.ConnectionInfo = crConnectionInfo
    23.     crTable.ApplyLogOnInfo(crTableLogOnInfo)
    24. Next
    25.  
    26. crReportDocument.PrintOptions.PaperOrientation = PaperOrientation.Landscape
    27. crReportDocument.PrintOptions.PaperSize = PaperSize.PaperA4
    28.  
    29.  
    30. CrystalReportViewer1.DisplayGroupTree = False
    31.  
    32. CrystalReportViewer1.Zoom(100)
    33. CrystalReportViewer1.ReportSource = crReportDocument
    "The dark side clouds everything. Impossible to see the future is."

  3. #3
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: VB 2005 and Cystal reports

    Read crystal report tutorial at my signature!

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