C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Errors and Solutions » General »

Crystal Report DB Login(VB.Net)


Posted Date: 01 Sep 2008    Resource Type: Errors and Solutions    Category: General
Author: Mohammed YahiyaMember Level: Silver    
Rating: 1 out of 5Points: 10



If you create crystal report( If data retrive from Database) in VB.Net project, you have to provide database login information. Everytime you run the report, The report page will ask user to login. Just add few lines in your page to solve this issue.

Add this line for Page load

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim myConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo()
myConnectionInfo.ServerName = "YourDBServerName"
myConnectionInfo.DatabaseName = "DBName"
myConnectionInfo.UserID = "DBUserID"
myConnectionInfo.Password = "DBUserPassword"
setDBLOGONforREPORT(myConnectionInfo)
End Sub


Add this line for DBLogin for Report

Private Sub setDBLOGONforREPORT(ByVal myconnectioninfo As CrystalDecisions.Shared.ConnectionInfo)
Dim mytableloginfos As New CrystalDecisions.Shared.TableLogOnInfos()
mytableloginfos = CrystalReportViewer1.LogOnInfo
For Each myTableLogOnInfo As CrystalDecisions.Shared.TableLogOnInfo In mytableloginfos
myTableLogOnInfo.ConnectionInfo = myconnectioninfo
Next
End Sub


In this above CrystalReportViewer1 change according to your crystalreportviewerid



Attachments

  • Crystal Report DB Login(VB.Net) ()


  • Responses


    No responses found. Be the first to respond and make money from revenue sharing program.

    Feedbacks      
    Popular Tags   What are tags ?   Search Tags  
    Sign In to add tags.
    Crystal Report Data Base Login  .  

    Post Feedback


    This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
    You must Sign In to post a response.
    Next Resource: How to avoid Multiple selection not allowed in DropDownList problem
    Previous Resource: NT AUTHORITY-NETWORK SERVICE does not have write access.
    Return to Discussion Resource Index
    Post New Resource
    Category: General


    Post resources and earn money!
     
    More Resources



    dotNet Slackers

    About Us    Contact Us    Privacy Policy    Terms Of Use