Crystal Reports随机询问SQL登录详细信息

时间:2015-03-18 16:50:25

标签: sql-server vb.net visual-studio-2010 crystal-reports

我正在使用Visual Studio 2010和SQL Server 2008 Express。我使用Crystal Reports创建了报告。

每当我需要查看报告时,我都会随机要求输入登录详细信息。我不知道如何克服这一点。

感谢所有帮助。

这是我的代码:

        Dim rptViewer As New rptAccidentClaim

        ' display CompanyName and footer  on Report
        Dim crCompa As Object
        Dim crFoote As Object
        crCompa = rptViewer.ReportDefinition.ReportObjects("crCompany")
        crCompa.Text = g_Company
        crFoote = rptViewer.ReportDefinition.ReportObjects("crFooterLine")
        crFoote.Text = g_FooterLine

        ' display Recipient Address on Report
        Dim crRecAddr1 As Object
        Dim crRecAddr2 As Object
        Dim crRecAddr3 As Object
        Dim crRecAddr4 As Object
        Dim crRecAddr5 As Object
        Dim crRecAddr6 As Object
        crRecAddr1 = rptViewer.ReportDefinition.ReportObjects("crAddressLine1")
        crRecAddr1.Text = g_AddressLine1
        crRecAddr2 = rptViewer.ReportDefinition.ReportObjects("crAddressLine2")
        crRecAddr2.Text = g_AddressLine2
        crRecAddr3 = rptViewer.ReportDefinition.ReportObjects("crAddressLine3")
        crRecAddr3.Text = g_AddressLine3
        crRecAddr4 = rptViewer.ReportDefinition.ReportObjects("crAddressLine4")
        crRecAddr4.Text = g_AddressLine4
        crRecAddr5 = rptViewer.ReportDefinition.ReportObjects("crAddressLine5")
        crRecAddr5.Text = g_AddressLine5
        crRecAddr6 = rptViewer.ReportDefinition.ReportObjects("crAddressLine6")
        crRecAddr6.Text = g_AddressLine6

        ' Set Database Logon Details 
        rptViewer.SetDatabaseLogon("sa", "(password)", "MAIN-PC", "(databasename)")
        'Pass filter Paramter
        rptViewer.SetParameterValue("theID", m_theID)
        crvAccidentClaim.ReportSource = rptViewer

1 个答案:

答案 0 :(得分:-1)

嗨我们遇到同样的问题..在寻找大量解决方案之后。我注意到,在youtube上的一个视频,他在水晶报告查看器中清除了附加的报告。 然后在代码中手动附加报告文件(.rpt)。现在我的程序中没有提示用户登录的提示信息。我希望你明白,我希望它会帮助你xD