|
-
May 7th, 2008, 06:35 AM
#1
Thread Starter
New Member
filtering reports in a dataenvironment in VB6
Hallo guys,
I'm still learning vB and would like to know how to filter report in a dataenvironment. For example I'm doing a water billing and would like to print an invoice for a customer and also a receipt.Another example would be to get all the customers with balances. Thanks in advance
-
May 7th, 2008, 07:30 AM
#2
Re: filtering reports in a dataenvironment in VB6
-
May 7th, 2008, 11:44 AM
#3
Hyperactive Member
Re: filtering reports in a dataenvironment in VB6
hi...
this is what i have done and it works.....though there may b bettr way to do it...and am new to vb.net this code i have used for vb.net 2003
Code:
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
Dim crForm As New FrmReportViewer
Dim Fltr As String
Dim mRpt As New rptRecoverySheetSent
Try
Dim CRViewer As New CrystalDecisions.Windows.Forms.CrystalReportViewer
crForm.CrystalReportViewer3.ReportSource = mRpt
Fltr = "{RecoveryStatmentSent.BranchCode} = '" & txtBranchCode.Text & "'"
If txtSubBranchCode.Text = Nothing Then
Else
Fltr = Fltr & " AND {RecoveryStatmentSent.SubBranchCode} = '" & txtSubBranchCode.Text & "'"
End If
Fltr = Fltr & " AND Day({RecoveryStatmentSent.FromDate}) = " & Day(dtpkFromDate.Value)
Fltr = Fltr & " AND Month({RecoveryStatmentSent.FromDate}) = " & Month(dtpkFromDate.Value)
Fltr = Fltr & " AND Year({RecoveryStatmentSent.FromDate}) = " & Year(dtpkFromDate.Value)
crForm.CrystalReportViewer3.SelectionFormula = (Fltr)
crForm.Show()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|