This is a discussion on Crystal Report in Vb.net within the VB.NET Programming forums, part of the Software Development category; I am using oracle 10g with vb.net. I am trying to make crystal report in vb.net. I have ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| I am using oracle 10g with vb.net. I am trying to make crystal report in vb.net. I have made it but when I am trying to view the report its asking me to login every time. Is there any solution for this? |
| Sponsored Links |
| |||
| You have asked very good question. Today it is a big problem in .NET Crystal report. This issue happens because of the "CrystalDecisions.CrystalReports.Engine.LogOnExcep tion". But Since I use the “push” method (generating an ADO.NET dataset first, then setting the report's DataSource), It is working fine for me. When you begin to design your report, you are prompted to connect to the Oracle database when you choose an OLEDB connection (CR.NET doesn't use ADO.NET, and ODBC requires a system DSN). Your choices are to use Integrated Security or to enter a user ID and password. If you choose Integrated Security, Visual Studio will use your credentials to connect to the Oracle database via Windows Authentication. If you choose to enter a user ID and password, VS will connect using Oracle authentication. You cannot enter another domain account in the user ID and password boxes and connect using those credentials via Windows Authentication. This information in these textboxes can only be used for Oracle authentication. Even though you must enter a password at this stage, the password information is not stored within the report file for security reasons. The password is only used to establish the database connection. This means you must apply logon information to each table at runtime. Integrated Security can only be used in two contexts: when inside Visual Studio (which, since it is a Windows Application, can directly use your network token to connect to the remote database), or when IIS and Oracle are on the same production machine. If you try to use Integrated Security on a production IIS Server with a remote Oracle, you will get the “Logon Failed” error. Sample Code Dim oReport As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent() oReport.Load(reportName) DoCRLogin(oReport) Public Sub DoCRLogin(ByRef oRpt As CrystalDecisions.CrystalReports.Engine.ReportDocum ent) Dim _applyLogin As New ApplyCRLogin ' use ApplyLogin object to apply login info to all tables in CR object _applyLogin._dbName = "Northwind" _applyLogin._passWord = "CrystalUser" _applyLogin._serverName = "(local)" _applyLogin._userID = "CrystalUser" _applyLogin.ApplyInfo(oRpt) ' clean up _applyLogin = Nothing End Sub Public Class ApplyCRLogin Public _dbName As String Public _serverName As String Public _userID As String Public _passWord As String Public Sub ApplyInfo(ByRef _oRpt As CrystalDecisions.CrystalReports.Engine.ReportDocum ent) Dim oCRDb As CrystalDecisions.CrystalReports.Engine.Database = _oRpt.Database Dim oCRTables As CrystalDecisions.CrystalReports.Engine.Tables = oCRDb.Tables Dim oCRTable As CrystalDecisions.CrystalReports.Engine.Table Dim oCRTableLogonInfo As CrystalDecisions.Shared.TableLogOnInfo Dim oCRConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo() oCRConnectionInfo.DatabaseName = _dbName oCRConnectionInfo.ServerName = _serverName oCRConnectionInfo.UserID = _userID oCRConnectionInfo.Password = _passWord For Each oCRTable In oCRTables oCRTableLogonInfo = oCRTable.LogOnInfo oCRTableLogonInfo.ConnectionInfo = oCRConnectionInfo oCRTable.ApplyLogOnInfo(oCRTableLogonInfo) Next End Sub End Class The class ApplyCRLogin has the method that applies the login to each table in the report. This is instantiated via the DoCRLogin method, which sets the user name, password, server name and database. In this instance, the login info is the same for all. A different method would have to be created to accommodate different tables to login. This seems to solve a lot of login problems similar to what I've mentioned. Hope you can get the reason for the crystol report logon error. Use ADO.NET dataset for runtime data. thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Karpagarajan : 04-24-2007 at 08:07 AM. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Crystal Report Issues | Sundaram | ASP and ASP.NET Programming | 0 | 03-10-2008 02:53 AM |
| Crystal Report Viewer | S.Vinothkumar | Ruby | 3 | 10-16-2007 05:35 AM |
| crystal reports | dips | ASP and ASP.NET Programming | 0 | 10-07-2007 06:00 AM |
| Export to Excel option is not working in Crystal Report with service pack 2 | tsureshk | ASP and ASP.NET Programming | 1 | 10-06-2007 03:57 AM |
| Implementing Crystal Report in Web Application | oxygen | C# Programming | 0 | 07-15-2007 11:40 PM |