Trancedified Posted February 10, 2004 Posted February 10, 2004 Hi, I have a table full of <Nulls> and at first my application loads the CrystalReportViewer correctly after I log into SQL Server via ODBC. However, when I close the CrystalReportViewer, the login window for SQL Server comes up again. I tried closing and closing, and even hitting the "Cancel" button but I still get the same window. Please see the attached picture. It only does it to this table, all my other reports work fine w/ different tables. Any solutions? Thanks! Chris Quote
Moderators Robby Posted February 11, 2004 Moderators Posted February 11, 2004 Are you passing the user and pw ? myReport.SetDatabaseLogon("username", "password") Quote Visit...Bassic Software
Trancedified Posted February 11, 2004 Author Posted February 11, 2004 Robby, No I never heard of it, I'll try it, hopefully I will still be able to close the CrystalReportViewer even with the <Nulls> Thanks! Chris Quote
Trancedified Posted February 11, 2004 Author Posted February 11, 2004 Robby, I tried it but there's no .SetDatabaseLogon("username", "password") after I hit the dot operator Here is my code (from a button) Private Sub cmdECSSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdECSSubmit.Click Dim previewer As New Previewer() If chOperationsAnchor1.Checked = False And chOperationsCount2.Checked = False Then Dim objCustomerName_AccountRep As New crCustomerName_AccountRep() previewer.ReportViewerRegular.ReportSource = objCustomerName_AccountRep crCustomerName_AccountRep.SetDatabaseLogon ("sa", "3cssql") previewer.ShowDialog() End Quote
Moderators Robby Posted February 11, 2004 Moderators Posted February 11, 2004 I have had that dialog prompt me in the past... but only when I had the incorrect info about the database or table. Are you 100% sure that you are pointing to the correct table/database? Quote Visit...Bassic Software
Trancedified Posted February 12, 2004 Author Posted February 12, 2004 Robby, Yeah all my information is correct. It is strange, once the report is first loaded into CrystalReportViewer, it's blank, however when I run a Start Date and End Date (from a DateTimePicker) the information populates appropriately. Private Sub cmdDate_DocType_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDate_DocType.Click Dim strStartDate As String Dim strEndDate As String strStartDate = DateTimePickerDate_DocTypeStart.Value strEndDate = DateTimePickerDate_DocTypeEnd.Value Dim objDate_DocType As CrystalDecisions.CrystalReports.Engine.ReportDocument objDate_DocType = New crDate_DocType() objDate_DocType.DataDefinition.RecordSelectionFormula = "{TD2.Date} >=#" & strStartDate & "# and {TD2.Date} <=#" & strEndDate & "#" ReportViewerDate_DocType.ReportSource = objDate_DocType ReportViewerDate_DocType.RefreshReport() 'Refresh report based on new date range criteria End Sub -But- When I try to close this report at run-time with the X button on the top right, that database login dialog box keeps showing up and won't go away. Table: TD2.Date (is a datetime datatype in SQL Server 2000) Any other advice, Robby? Thanks Chris Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.