.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 3rd, 2004, 07:13 AM
medirta medirta is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 medirta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Login Failed Report with Sub Report 2 Connections



I have created a Report with a Subreport and both have 2 connection
informations. Viz. Main Report has 2 connection - 1 connection to
datasource using Stored Procedure (SQL Server) and second connection
to datasource which provides fields based upon Language selected say
english, spanish etc. so we have one seprate Language Database.
Similar is the case with Sub Report. Now when I am passing the
connection info as shown below in Steps to Reproduce, then 1st page
gets displayed perfectly but clicking on the second page gives the
Login Failed Error, but if i have only 1 connection in both main
report and sub report the same code works fine. Is there any
resolution to this???



Further to it, so ease the problem, I tried this
Main Report - 1 Connection - to DB1
Sub Report - 1 Connection to DB2

I am storing the table wise connection information in web.config and in code applying the connection as per the table, so connections doesnt get mixed up. But this also leads to the same problem as described below.

Please help me out....need your advice desperately. Thanks in advance for your time and efforts.

Best Regards,
Ashish



CODE______________________________________________ ___________________
__
Page_Init()

If TypeOf Session.Item("CESession") Is Object Then
ceSession = Session.Item("CESession")
Else
If LoginCrystalEnterprise(ConfigurationSettings.AppSe ttings
("Username"), ConfigurationSettings.AppSettings("Password"),
ConfigurationSettings.AppSettings("CmsServer"),
ConfigurationSettings.AppSettings("AuthenticationType")) Then
ceSession = Session.Item("CESession")
End If
End If

reportDoc.EnterpriseSession = ceSession
reportDoc.FileName = ConfigurationSettings.AppSettings("Uri") &
GetReportId(reportSource, reportDoc.EnterpriseLogonInfo.Username,
reportDoc.EnterpriseLogonInfo.Password,
reportDoc.EnterpriseLogonInfo.CmsServer,
reportDoc.EnterpriseLogonInfo.AuthenticationType)

Call CreateParameterFieldsDirect(returnParameters, reportDoc)

For Each objSection In reportDoc.ReportDefinition.Sections
For Each objReportObject In objSection.ReportObjects
If objReportObject.Kind = ReportObjectKind.SubreportObject Then
Dim objDatabaseSubreport As
CrystalDecisions.CrystalReports.Engine.Database
Dim objTablesSubreport As
CrystalDecisions.CrystalReports.Engine.Tables
Dim objTableLogonInfoSubreport As
CrystalDecisions.Shared.TableLogOnInfo
Dim objTableSubreport As CrystalDecisions.CrystalReports.Engine.Table
Dim objCrystalConnectionInfoSubreport As CrystalConnectionInformation

Try
objSubReportObject = CType(objReportObject, SubreportObject)
subreportDoc = objSubReportObject.OpenSubreport
(objSubReportObject.SubreportName)
objDatabaseSubreport = subreportDoc.Database
objTablesSubreport = objDatabaseSubreport.Tables
For Each objTableSubreport In objTablesSubreport
objTableLogonInfoSubreport = objTableSubreport.LogOnInfo
objCrystalConnectionInfoSubreport = objHashTable.Item
(objTableSubreport.Name.ToLower)
Dim objConnectionInfoSubreport As New
CrystalDecisions.Shared.ConnectionInfo
objConnectionInfoSubreport.ServerName =
objCrystalConnectionInfoSubreport.ServerName
objConnectionInfoSubreport.UserID =
objCrystalConnectionInfoSubreport.UserId
objConnectionInfoSubreport.DatabaseName =
objCrystalConnectionInfoSubreport.DatabaseName
objConnectionInfoSubreport.Password =
objCrystalConnectionInfoSubreport.Password
objTableLogonInfoSubreport.ConnectionInfo =
objConnectionInfoSubreport
System.Threading.Thread.CurrentThread.Sleep(waitTi me)
objTableSubreport.ApplyLogOnInfo(objTableLogonInfo Subreport)
System.Threading.Thread.CurrentThread.Sleep(waitTi me)
'intCounter = 0
'objTableSubreport.ApplyLogOnInfo(objTableLogonInf oSubreport)
'System.Threading.Thread.CurrentThread.Sleep(waitT ime)
'While (Not objTableSubreport.TestConnectivity()) And (intCounter <
ConfigurationSettings.AppSettings("maxConnectionCounter"))
'System.Threading.Thread.CurrentThread.Sleep(waitT ime)
'intCounter += 1
'End While

If Not objTableSubreport.TestConnectivity() Then
Throw New ApplicationException("Unable to Connect Table:" &
objTableSubreport.Name & " Connection Info:" &
objConnectionInfoSubreport.ServerName)
End If
Next
Finally
objDatabaseSubreport = Nothing
objTablesSubreport = Nothing
objTableLogonInfoSubreport = Nothing
objTableSubreport = Nothing
objCrystalConnectionInfoSubreport = Nothing
End Try
End If
Next
Next

objDatabase = reportDoc.Database
objTables = objDatabase.Tables

For Each objTable In objTables
objTableLogonInfo = objTable.LogOnInfo
objCrystalConnectionInfo = objHashTable.Item(objTable.Name.ToLower)
Dim objConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
objConnectionInfo.ServerName = objCrystalConnectionInfo.ServerName
objConnectionInfo.UserID = objCrystalConnectionInfo.UserId
objConnectionInfo.DatabaseName =
objCrystalConnectionInfo.DatabaseName
objConnectionInfo.Password = objCrystalConnectionInfo.Password
objTableLogonInfo.ConnectionInfo = objConnectionInfo
System.Threading.Thread.CurrentThread.Sleep(waitTi me)
objTable.ApplyLogOnInfo(objTableLogonInfo)
System.Threading.Thread.CurrentThread.Sleep(waitTi me)
intCounter = 0
'objTable.ApplyLogOnInfo(objTableLogonInfo)
'System.Threading.Thread.CurrentThread.Sleep(waitT ime)
'While (Not objTable.TestConnectivity()) And (intCounter <
ConfigurationSettings.AppSettings("maxConnectionCounter"))
'System.Threading.Thread.CurrentThread.Sleep(waitT ime)
'intCounter += 1
'End While

If Not objTable.TestConnectivity() Then
Throw New ApplicationException("Unable to Connect Table:" &
objTable.Name & " Connection Info:" & objConnectionInfo.ServerName)
End If
Next

crystalReportViewer.DataBind()


ERROR----------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
-------------

Server Error in '/Reports' Application.
---------------------------------------------------------------------
-----------

Logon failed. Details: 28000:[Microsoft][ODBC SQL Server Driver][SQL
Server]Login failed for user 'demodb_cds'. Error in File
C:\WINDOWS\TEMP\{6384703C-1EDA-4AA8-95CF-84C30EB995E8}.rpt: Unable
to connect: incorrect log on parameters.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException:
Logon failed. Details: 28000:[Microsoft][ODBC SQL Server Driver][SQL
Server]Login failed for user 'demodb_cds'. Error in File
C:\WINDOWS\TEMP\{6384703C-1EDA-4AA8-95CF-84C30EB995E8}.rpt: Unable
to connect: incorrect log on parameters.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location
of the exception can be identified using the exception stack trace
below.

Stack Trace:


[COMException (0x8004100f): Logon failed.
Details: 28000:[Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'demodb_cds'.
Error in File C:\WINDOWS\TEMP\{6384703C-1EDA-4AA8-95CF-
84C30EB995E8}.rpt:
Unable to connect: incorrect log on parameters.]

CrystalDecisions.ReportAppServer.Controllers.Repor tSourceClass.GetPag
e(PageRequestContext pPageRequestContext) +0
CrystalDecisions.ReportSource.EromReportSourceBase .GetPage
(PageRequestContext pageReqContext)

[LogOnException: Logon failed.
Details: 28000:[Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'demodb_cds'.
Error in File C:\WINDOWS\TEMP\{6384703C-1EDA-4AA8-95CF-
84C30EB995E8}.rpt:
Unable to connect: incorrect log on parameters.]

CrystalDecisions.ReportAppServer.ConvertDotNetToEr om.ThrowDotNetExcep
tion(Exception e)
CrystalDecisions.ReportSource.EromReportSourceBase .GetPage
(PageRequestContext pageReqContext)
CrystalDecisions.CrystalReports.Engine.FormatEngin e.GetPage
(PageRequestContext reqContext)
CrystalDecisions.ReportSource.LocalReportSourceBas e.GetPage
(PageRequestContext pageReqContext)
CrystalDecisions.Web.ReportAgent.‑(Boolean i)
CrystalDecisions.Web.CrystalReportViewer.OnPreRend er(EventArgs e)
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Page.ProcessRequestMain()

Reply With Quote
  #2  
Old August 4th, 2004, 02:07 PM
adurstew's Avatar
adurstew adurstew is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Charlotte, NC
Posts: 114 adurstew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 33 sec
Reputation Power: 7
Send a message via AIM to adurstew Send a message via Yahoo to adurstew
could you post your sql connections?
__________________
Andrew J Durstewitz
ASP.NET,VB.NET,SQL Developer

http://madashellnc.blogspot.com

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Login Failed Report with Sub Report 2 Connections


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT