Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SELECT Records for Crystal Report

Posted on 2006-11-23
1
Medium Priority
?
221 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

604 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