?
Solved

SELECT Records for Crystal Report

Posted on 2006-11-23
1
Medium Priority
?
219 Views
Last Modified: 2010-04-23
Hi all,

I am having a problem with record selection for one of my reports.

I am using this code:

Me.Cursor = Cursors.WaitCursor
        Dim crReportDocument As contacten
        Me.Cursor = Cursors.WaitCursor
        Dim sqlString As String = "Select * From tblcontacten where organisatie = 'Scholen'"
        adapt = New OleDb.OleDbDataAdapter(sqlString, conn)
        Dim rp As DataSet = New DataSet()
        adapt.Fill(rp, "contacten")
        crReportDocument = New contacten
        crReportDocument.SetDataSource(rp)
        crvw2.ShowPrintButton = True
        crvw2.ShowExportButton = False
        crvw2.ShowGroupTreeButton = False
        crvw2.ReportSource = crReportDocument
        crvw2.ShowPageNavigateButtons = False
        crvw2.Zoom(80)
        Me.Cursor = Cursors.Default

but this always returns every record, no selectionis made

However, I am using the same code for another report:

Dim crReportDocument As kassa
        Dim kas As String = ComboBox2.Text
        crvw1.Visible = True
        Me.Cursor = Cursors.WaitCursor
        Dim sqlString As String = "Select * From " & kas & " where debet<>0"
        adapt = New OleDb.OleDbDataAdapter(sqlString, conn)
        ds = New DataSet()
        adapt.Fill(ds, "kassa")
        crReportDocument = New kassa
        crReportDocument.SetDataSource(ds)
        crvw1.ShowPrintButton = True
        crvw1.ShowExportButton = False
        crvw1.ShowGroupTreeButton = False
        crvw1.ReportSource = crReportDocument
        crvw1.ShowPageNavigateButtons = False
        crvw1.Zoom(80)
        Me.Cursor = Cursors.Default

and this works fine.

I have restarted creating the report 3 times, thinking there was something I had done differently, but that did'nt help.
I have verified the SQL in the database, this returns a selection of records.

Suggestions?
0
Comment
Question by:JamesBrian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 21

Accepted Solution

by:
K V earned 2000 total points
ID: 18002548
well the logic ur implementing of assigning ds to cr is ok !! ive not really checked that
but better you check with this. this working fine:-

Private Sub cmdCountry_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim custReport As Report1_View
        custReport = New Report1_View
        custReport.CrystalReportViewer1.ReportSource = rptParameter
        custReport.CrystalReportViewer1.SelectionFormula = "{Customers.Country}='Brazil'"
        custReport.Show()
End Sub
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question