Topic: Crystal Ask for Login Posted: 05 Aug 2010 at 4:08am
Hi! I'm having an issues with crystal Report, on witch I cant find a solution. And I need help.
I know this question have allready been ask a thousand time, but I cannot find any solution over the web.
The problem is; At time when My Report is display on the Crystal Report Preview, crystal ask me for the Database Login. but this occur only at on one site and I cannot reproduce the problem on my computer or any other computer.
Here a bit about the environment; - The Report is directly connected to the SQL Server engine Database - I'm using Crystal Report 2005 (supplied with Visual Studio 20005) - This is coded with VB.NET 2005 - Crystal DLL are all the same on all site.
Before calling the display of the report in the Crystal Raport Preview, i'm changing the crystal Report database connection using this procedure:
Private Function SetDatabaseConnectionString(ByVal pRpt As ReportDocument) As ReportDocument
Dim oSQLConn As New System.Data.SqlClient.SqlConnectionStringBuilder(Informat.Data.CurrentDatabase.Database.ConnectionString.ConnectionString) Dim oDBConnInfo As New TableLogOnInfo Dim oTableConnInfo As New TableLogOnInfo Dim oConnInfo As New ConnectionInfo
'****************************************************** For itbl As Int32 = 0 To pRpt.Database.Tables.Count - 1 oTableConnInfo = pRpt.Database.Tables(itbl).LogOnInfo oTableConnInfo.ConnectionInfo = oConnInfo pRpt.Database.Tables(itbl).ApplyLogOnInfo(oTableConnInfo) Next itbl
'****************************************************** ' Maintenant pour tout les SubReport ' Noté que un SubReport ne peut pas contenir d'autre SubReport
For iSubRpt As Int32 = 0 To pRpt.Subreports.Count - 1 For iSubTbl As Int32 = 0 To pRpt.Subreports(iSubRpt).Database.Tables.Count - 1 oTableConnInfo = pRpt.Subreports(iSubRpt).Database.Tables(iSubTbl).LogOnInfo oTableConnInfo.ConnectionInfo = oConnInfo pRpt.Subreports(iSubRpt).Database.Tables(iSubTbl).ApplyLogOnInfo(oTableConnInfo) Next iSubTbl pRpt.Subreports(iSubRpt).SetDatabaseLogon(oSQLConn.UserID, oSQLConn.Password, oSQLConn.DataSource, oSQLConn.InitialCatalog, True)
Next iSubRpt
pRpt.Refresh()
Return pRpt End Function
I've try many diffrent way to change the connection but whatever I try, the report preview ask me for Database identification.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum