Solved

SELECT Records for Crystal Report

Posted on 2006-11-23
1
213 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
1 Comment
 
LVL 21

Accepted Solution

by:
theGhost_k8 earned 500 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Populating an array of locale_time_info 8 46
send messages to whatsapp programatically 2 49
Need a starter for ETL protocol? 4 57
Write to a printer using vb.net 9 30
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 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