我正在修改ASP.Net应用程序以在Visual Studio 2012中使用新版本的水晶报表(13)。当我在本地运行它们并且它们在内部测试服务器上工作时报告有效但是它们不# 39;在这个应用程序必须存在的面向外部的生产服务器上工作。
我收到了数据库登录提示......但我不应该因为我正在使用" push"通过为报表分配数据源的方法。我已经梳理了每个领域,我无法想象数据集与数据库和水晶报告之间会出现什么不匹配。我们还确保新版本的水晶报告位于发生故障的服务器上。
以下是加载报告的代码:
Dim dsWaitsrc As New dsWaitlistDetail
Using dbConn As New System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("CS_eRegdbConnectionString").ConnectionString)
Dim cmd As New System.Data.SqlClient.SqlCommand("SELECT CL_Index.CL_ID, CL_EMail, CL_Contact, CL_Surname, CL_FirstName, CL_Gender, CL_BirthDate, CL_Income, CL_Reason, CL_Language, CL_Interpretor, CL_WorkingAt, CL_SchoolAt, CL_Marital, CL_Surname2, CL_FirstName2, CL_Gender2, CL_BirthDate2, CL_Income2, CL_Reason2, CL_WorkingAt2, CL_SchoolAt2, CL_Date_Submitted, CL_Index.Updated, CL_Prokids, CL_Resource, CL_ChildCare, CL_Phone, CL_Type, CL_Extension, CL_Phone2, CL_Type2, CL_Extension2, CL_Phone3, CL_Type3, CL_Extension3, (CASE WHEN (CL_Index.CL_Income = 'Ontario Works ( Social Assistance )') THEN '0' + CONVERT(VARCHAR, CL_Index.CL_Date_Submitted) + STR(CL_Index.CL_ID) ELSE '1' + CONVERT(VARCHAR, CL_Index.CL_Date_Submitted) + STR(CL_Index.CL_ID) END) AS rpt_sort, Comments, CL_Camp, PreferredTime, Camp_Type, CL_Behavior, Preference, OtherSource, CH_Surname, CH_FirstName, CH_Gender, CH_BirthDate, CH_Service, ADD_Address, ADD_Unit, ADD_Postal, CL_City FROM CL_Index LEFT OUTER JOIN CL_Addresses ON CL_Index.CL_ID = CL_Addresses.Index_CL_ID LEFT OUTER JOIN CL_City ON CL_Addresses.City_CL_ID = CL_City.CL_ID LEFT OUTER JOIN CL_Children ON CL_Index.CL_ID = CL_Children.Index_CL_ID WHERE CL_Index.CL_ID = " & Request("CL_ID"), dbConn)
cmd.Connection.Open()
Using rs As System.Data.SqlClient.SqlDataReader = cmd.ExecuteReader
While rs.Read
dsWaitsrc.Tables("CL_Index").Rows.Add(DBString(rs!CL_Contact), DBString(rs!CL_Surname), DBString(rs!CL_FirstName), DBString(rs!CL_Gender), DBDate(rs!CL_BirthDate), DBString(rs!CL_Income), DBString(rs!CL_Reason), DBString(rs!CL_Language), CBool(rs!CL_Interpretor), DBString(rs!CL_WorkingAt), DBString(rs!CL_SchoolAt), DBString(rs!CL_Marital), DBString(rs!CL_Surname2), DBString(rs!CL_FirstName2), DBString(rs!CL_Gender2), DBDate(rs!CL_Birthdate2), DBString(rs!CL_Income2), DBString(rs!CL_Reason2), DBString(rs!CL_WorkingAt2), DBString(rs!CL_SchoolAt2), DBDate(rs!CL_Date_Submitted), CBool(rs!Updated), CBool(rs!CL_ProKids), CBool(rs!CL_Resource), CBool(rs!CL_ChildCare), DBString(rs!CL_Phone), DBString(rs!CL_Type), DBString(rs!CL_Extension), DBString(rs!CL_Phone2), DBString(rs!CL_Type2), DBString(rs!CL_Extension2), DBString(rs!CL_Phone3), DBString(rs!CL_Type3), DBString(rs!CL_Extension3), DBString(rs!CH_Surname), DBString(rs!CH_FirstName), DBString(rs!CH_Gender), DBDate(rs!CH_BirthDate), DBString(rs!ADD_Address), DBString(rs!ADD_Unit), DBString(rs!ADD_Postal), DBString(rs!CL_City), CBool(rs!CH_Service), DBString(rs!rpt_sort), DBInt(rs!CL_ID), DBString(rs!CL_EMail), DBString(rs!Comments), CBool(rs!CL_Camp), DBString(rs!PreferredTime), DBString(rs!Camp_Type), CBool(rs!CL_Behavior), DBString(rs!Preference), DBString(rs!OtherSource))
End While
End Using
End Using
RPT.setdatasource(dsWaitsrc)
Me.WaitlistReport.ReportSource = RPT
Me.WaitlistReport.Visible = True
感谢您提供的任何帮助,以摆脱此数据库提示。
答案 0 :(得分:0)
你错过了Me.WaitlistReport.DataBind();设置ReportSource后