Wrox Programmer Forums
|
BOOK: Professional Crystal Reports for VS.NET
This is the forum to discuss the Wrox book Professional Crystal Reports for Visual Studio .NET by David McAmis; ISBN: 9780764544033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Crystal Reports for VS.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 22nd, 2004, 08:42 AM
Registered User
 
Join Date: Mar 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default login window comes in crystal reports

hi
i have developed crystal reports (vb.NET 2003 version)
it asks for Login and server name etc.
i mena in report viewer login window comes .. this happens when the server is changed
for example client side or installatin site..

but in my code i am also allocating login info and stuff run time.

belolw is the code that does that

-----------------------------------------------------------
rep.Load(Application.StartupPath & "\report\" & rptFileName)
' loading rpt file


'-- below constr is the connection string info for SQL server
'-- i am splitting information to get server name and pwd and uid stuff from app.config file ia

have made
'
   Private Sub InitializeReport()
        rep.Load(Application.StartupPath & "\report\" & rptFileName)

        Dim tempservinfo() As String = Split(strConnect, ";")
        Dim server, database, uname, pword
        server = Split(tempservinfo(0), "=")
        database = Split(tempservinfo(1), "=")
        If tempservinfo.Length > 3 Then
            uname = Split(tempservinfo(2), "=")
            pword = Split(tempservinfo(3), "=")
        Else
            uname = ""
            pword = ""
        End If
        rep.SetDatabaseLogon(uname(1), pword(1), server(1), database(1))
        Dim MyLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
        Dim MyTable As CrystalDecisions.CrystalReports.Engine.Table
        For Each MyTable In rep.Database.Tables


            MyLogonInfo = MyTable.LogOnInfo
            If (MyTable.Name = "") Then
                MyLogonInfo.ConnectionInfo.UserID = uname(1)
                MyLogonInfo.ConnectionInfo.Password = pword(1)
                MyLogonInfo.ConnectionInfo.ServerName = server(1)
                MyLogonInfo.ConnectionInfo.DatabaseName = database(1)
            Else
                MyLogonInfo.ConnectionInfo.UserID = uname(1)
                MyLogonInfo.ConnectionInfo.Password = pword(1)
                MyLogonInfo.ConnectionInfo.ServerName = server(1)
                MyLogonInfo.ConnectionInfo.DatabaseName = database(1)
                MyTable.ApplyLogOnInfo(MyLogonInfo)
            End If



        Next
        CrystalReportViewer1.ReportSource = rep

' rep variable is report document

        CrystalReportViewer1.LogOnInfo(0).ConnectionInfo.S erverName = server(1)
        CrystalReportViewer1.LogOnInfo(0).ConnectionInfo.D atabaseName = database(1)
        CrystalReportViewer1.LogOnInfo(0).ConnectionInfo.U serID = uname(1)
        CrystalReportViewer1.LogOnInfo(0).ConnectionInfo.P assword = pword(1)

        CrystalReportViewer1.SelectionFormula = rptSelectFormula
    End Sub
-------------------------------------------------------------------------

in above code everything works fine i have checked while doing debugging and all information

goes properly but then also that login window comes

also the thing is i am not using tables straight away in reports for data
i am using view and qeries i have built in databse.

any help would be helpfull ASAP plz
thanx in advance
Nilesh


 
Old October 7th, 2004, 03:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

I donno ur case but if u set ur ReportSource after connetion part it'll ask it.

Always:),
Hovik Melkomian.
 
Old October 15th, 2004, 12:57 AM
Registered User
 
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ian.santos Send a message via MSN to ian.santos Send a message via Yahoo to ian.santos
Default

i also encounter the said issue, however i am using an XSD file as a replicate of the dataset which i pass.

tnx,
ian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Reports 8 second login liam8611 Classic ASP Basics 0 July 23rd, 2007 08:32 AM
Crystal Reports - DataBase Login - C# aranhamarvel C# 0 April 11th, 2007 02:16 PM
Newbie Crystal Reports Login redbull8vodka Crystal Reports 0 January 19th, 2007 07:25 AM
login error - passing data set to crystal reports bsharris Crystal Reports 0 September 14th, 2004 03:38 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.