[RESOLVED] Crystal Reports Suppress
I am having a problem with the Crystal Reports viewer in vb.net 2003. I have conditionally formatted the details section of the report in the built-in report designer using parameter values that the user is prompted for (a date range). I'm trying to get records to show that are only in that date range, but it is showing all of them instead. I am grabbing data from a MySQL 5 table. Here is the relevant report-loading code:
VB Code:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports MySql.Data.MySqlClient
Imports System.Data
Public Class fclsShowReport
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
<code cut>
#End Region
Public conn As New MySqlConnection
Public comm As New MySqlCommand
Public da As New MySqlDataAdapter
Public dtcustomerinfo As New DataTable
Public dtaccountinfo As New DataTable
Public dstransactioninfo As New DataSet
Public rowindexdtcustomerinfo As New Double
Public rowindexdtaccountinfo As New Double
Public rowindexdttransactioninfo As New Double
Dim myReport As New ReportDocument
Public SQL As String
Private Sub fclsShowReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
crViewer.Width = fclsShowReport.ActiveForm.Width - 10
crViewer.Height = fclsShowReport.ActiveForm.Height - 10
SQL = "SELECT AccountNumber,Description,Amount,Date,customerinfo.CustID,TransactionNumber,LastName,FirstName FROM CustomerInfo INNER JOIN Transactions ON CustomerInfo.CustID = Transactions.CustID"
conn.ConnectionString = "server=localhost;user id=root;password=;database=finance_records"
Try
conn.Open()
comm.CommandText = SQL
comm.Connection = conn
da.SelectCommand = comm
da.Fill(dstransactioninfo)
myReport.Load("..\CustomerStatement.rpt")
myReport.SetDataSource(dstransactioninfo)
crViewer.ReportSource = myReport
Catch ex As Exception
MessageBox.Show(ex.Message, "Report could not be created", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub fclsShowReport_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
crViewer.Width = fclsShowReport.ActiveForm.Width - 10
crViewer.Height = fclsShowReport.ActiveForm.Height - 10
End Sub
End Class
The formula I placed into the conditional suppress section of the details section is this:
{Table.Date} < {?BeginningDate} AND {Table.Date} > {?EndingDate}
If any additional information is required, I would be happy to oblige.
Thanks in advance.
Re: Crystal Reports Suppress
I think change AND to OR will do the trick.
Re: Crystal Reports Suppress
I feel really dumb. Wow. Thanks alot. That did the trick.