Hi to all...
I have problem with subreport logon...
I have app running on one pc with SQL2005Express installed on that machine. Reports are working fine, with logoninfo or without it, with setting logon details for each subreport or with no setting.
Over mapped drive other users are starting that same app and they get log on error on reports with subreports. Reports with no subreports are working fine. Been everywhere, tried everything....
Subreports and main report are SQLNCLI...installed that on all machines starting app...
Tried to change provider in code....no luck.
Form with crystal print preview is opening but it is asking for uname and pwd...If I type them or choose integrated security, still the same.
I'm using VS2010
my code:
Dim oRpt As New rptKalkulacijaCene
myConnectionInfo.AllowCustomConnection = True
myConnectionInfo.ServerName = sServer
myConnectionInfo.DatabaseName = "Oktan"
If My.Settings.CNN.Contains("Password") Then
Dim builder As New System.Data.SqlClient.SqlConnectionStringBuilder(My.Settings.CNN)
myConnectionInfo.Password = builder.Password
myConnectionInfo.UserID = builder.UserID
Else
myConnectionInfo.IntegratedSecurity = True
End If
myConnectionInfo.Type = ConnectionInfoType.SQL
Dim myTables As Tables = oRpt.Database.Tables
For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables
Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo
myTableLogonInfo.ConnectionInfo = myConnectionInfo
myTable.ApplyLogOnInfo(myTableLogonInfo)
myTable.LogOnInfo.ConnectionInfo.ServerName = myConnectionInfo.ServerName
'For i As Integer = 0 To myTable.LogOnInfo.ConnectionInfo.LogonProperties.Count - 1
' If myTable.LogOnInfo.ConnectionInfo.LogonProperties(i).name = "Provider" Then
' myTable.LogOnInfo.ConnectionInfo.LogonProperties(i).value = "SQLOLEDB"
' End If
'Next
Next
Dim subReportDoc As CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim subReports As CrystalDecisions.CrystalReports.Engine.Subreports
subReports = oRpt.Subreports
For i As Integer = 0 To subReports.Count - 1
subReportDoc = subReports(i)
For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In subReportDoc.Database.Tables
Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo
myTableLogonInfo.ConnectionInfo = myConnectionInfo
myTable.ApplyLogOnInfo(myTableLogonInfo)
myTable.LogOnInfo.ConnectionInfo.ServerName = myConnectionInfo.ServerName
Next
Next
oRpt.RecordSelectionFormula = "{vw_sintetika_analitika_rpt.id_godine}=" & iPoslovnaGodina & " and {vw_sintetika_analitika_rpt.TipDokumenta}=" & eTip & " and {vw_sintetika_analitika_rpt.BrojDokumenta} in[" & lblKombinacija.Tag & "]"
Dim bTree As Boolean = False
Dim x As New Form2
bTree = True
x.CrystalReportViewer1.ReportSource = oRpt
x.CrystalReportViewer1.ShowGroupTreeButton = bTree
x.CrystalReportViewer1.DisplayGroupTree = bTree
x.ShowDialog()
Any suggestions?