Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

  • Moderators
Posted

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?

Visit...Bassic Software
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...