Results 1 to 3 of 3

Thread: filtering reports in a dataenvironment in VB6

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2008
    Posts
    4

    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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: filtering reports in a dataenvironment in VB6

    Moved to Reporting

  3. #3
    Hyperactive Member kuldevbhasin's Avatar
    Join Date
    Mar 2008
    Location
    Mumbai, India
    Posts
    493

    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
  •  



Click Here to Expand Forum to Full Width