Prev: How to check if a file is open
Next: GetLongPathNameA
From: Murali via DotNetMonster.com on 24 Sep 2005 06:05 Hi All I am new to .net, as i worked majorily on VB6.0 & Crystal reports, I have developed an Window application in VB.net/SQL Server2000 and using Crystal reports8.5, I have used the CRViewer in the form. Now my problem is when i try to open Crystal report thro VB.net, it will prompt for database login password, which i have already supplied in Crystal report and also thro the application.(I am using DSN based connection) Please help me to solve this problem.... Sample Code. { on Button click... Dim rpt1 As New Form2 ' Here Form2 is the form with CrystalReportViewer, ReportSource in Viewer is set to RPT file... rpt1.Show() } Thanks in advance.... I apoligise if this is the wrong forum to post this question. Regards, Murali -- Murali VSM Software (P) Ltd. Bangalore
From: Phil G. on 24 Sep 2005 08:08 Hi, You state 'it will prompt for database login password, which i have already supplied in Crystal report'. Have you supplied this info. in the wizard for the db connection or have you hard-coded it? If you have hard-coded it can you provide an example. Rgds, Phil "Murali via DotNetMonster.com" <forum(a)DotNetMonster.com> wrote in message news:54D69A8DD781B(a)DotNetMonster.com... > Hi All > I am new to .net, as i worked majorily on VB6.0 & Crystal reports, > I have developed an Window application in VB.net/SQL Server2000 and using > Crystal reports8.5, I have used the CRViewer in the form. > Now my problem is when i try to open Crystal report thro VB.net, it will > prompt for database login password, which i have already supplied in > Crystal > report and also thro the application.(I am using DSN based connection) > Please help me to solve this problem.... > > Sample Code. > { > on Button click... > Dim rpt1 As New Form2 ' Here Form2 is the form with > CrystalReportViewer, > ReportSource in Viewer is set to RPT file... > rpt1.Show() > } > Thanks in advance.... > I apoligise if this is the wrong forum to post this question. > > Regards, > Murali > > -- > Murali > VSM Software (P) Ltd. > Bangalore
From: Murali via DotNetMonster.com on 26 Sep 2005 00:42 HI Phil! I had used DSN connection, during the design time i selected the required views & fields...And through VB.net i open the Report ( I have used CRViewer in a form and i open that form on click of a button from the main form.) Please help.... Regards, Murali Phil G. wrote: >Hi, > >You state 'it will prompt for database login password, which i have already >supplied in Crystal report'. Have you supplied this info. in the wizard for >the db connection or have you hard-coded it? If you have hard-coded it can >you provide an example. > >Rgds, Phil > >> Hi All >> I am new to .net, as i worked majorily on VB6.0 & Crystal reports, >[quoted text clipped - 19 lines] >> Regards, >> Murali -- Murali VSM Software (P) Ltd. Bangalore,India Message posted via DotNetMonster.com http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-vb-net/200509/1
From: Phil G. on 26 Sep 2005 15:28 Hi Murali, Unfortunately I made this 'mistake'! :-) Although you will probably see that the pop-up login info box always includes the login name, it still requires the password. This apparently is the correct operation, although personally I don't see the need for specifically coding the info. if it has already been entered through the IDE. However, what you need to do is use the TableLogonInfo Class of CR. Here's an example:- [Global Decs] Dim objRepDoc As New ReportDocument Dim crTable As Table Dim crLogInfo As CrystalDecisions.Shared.TableLogOnInfo [method call - maybe in load or cmdbutton] crTable = objRepDoc.Database.Tables(0) crLogInfo = crTable.LogOnInfo With crLogInfo.ConnectionInfo .UserID = "username" .Password = "password" End With crTable.ApplyLogOnInfo(crLogInfo) frmRep.CRViewer.ReportSource = objRepDoc frmRep.Show() Let me know if you have problems. Good luck. Phil "Murali via DotNetMonster.com" <u14242(a)uwe> wrote in message news:54ecef9ca0618(a)uwe... > HI Phil! > I had used DSN connection, during the design time i selected the required > views & fields...And through VB.net i open the Report ( I have used > CRViewer > in a form and i open that form on click of a button from the main form.) > > Please help.... > > Regards, > Murali > > Phil G. wrote: >>Hi, >> >>You state 'it will prompt for database login password, which i have >>already >>supplied in Crystal report'. Have you supplied this info. in the wizard >>for >>the db connection or have you hard-coded it? If you have hard-coded it can >>you provide an example. >> >>Rgds, Phil >> >>> Hi All >>> I am new to .net, as i worked majorily on VB6.0 & Crystal reports, >>[quoted text clipped - 19 lines] >>> Regards, >>> Murali > > -- > Murali > VSM Software (P) Ltd. > Bangalore,India > > > Message posted via DotNetMonster.com > http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-vb-net/200509/1
From: Murali via DotNetMonster.com on 27 Sep 2005 07:37
Hi Phil ! This code does not helped me..... I got similar code from the website, It works in my system and does not in my clients system... Both have VS2003 and .net Framework1.1, Crystal report 8.5... I found an alternative solution for this i have created a user with blank password in the SQL Server and this login i am using for opening the crystal reports.. Anyway please suggest an alternative option.... Regards, Murali Phil G. wrote: >Hi Murali, > >Unfortunately I made this 'mistake'! :-) > >Although you will probably see that the pop-up login info box always >includes the login name, it still requires the password. This apparently is >the correct operation, although personally I don't see the need for >specifically coding the info. if it has already been entered through the >IDE. > >However, what you need to do is use the TableLogonInfo Class of CR. Here's >an example:- > >[Global Decs] > >Dim objRepDoc As New ReportDocument >Dim crTable As Table >Dim crLogInfo As CrystalDecisions.Shared.TableLogOnInfo > >[method call - maybe in load or cmdbutton] > >crTable = objRepDoc.Database.Tables(0) >crLogInfo = crTable.LogOnInfo > With crLogInfo.ConnectionInfo > .UserID = "username" > .Password = "password" > End With >crTable.ApplyLogOnInfo(crLogInfo) >frmRep.CRViewer.ReportSource = objRepDoc >frmRep.Show() > >Let me know if you have problems. Good luck. Phil > >> HI Phil! >> I had used DSN connection, during the design time i selected the required >[quoted text clipped - 23 lines] >>>> Regards, >>>> Murali -- Murali VSM Software (P) Ltd. Bangalore,India Message posted via http://www.dotnetmonster.com |