Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Filtering Crystal Report 10 using vb6 (RPT format) Post Reply Post New Topic
Author Message
peaceandlove
Newbie
Newbie


Joined: 02 Mar 2012
Online Status: Offline
Posts: 2
Quote peaceandlove Replybullet Topic: Filtering Crystal Report 10 using vb6 (RPT format)
     Posted: 02 Mar 2012 at 9:17pm
I am using vb6 and crystal report 10 (sql server 200 as database) to display record.

I am using .rpt format for crystal report to display data. I am using net examples I am successfully able to display the data but unable to filter it.

I want to know what is the syntax,formula for filtering the report using vb6.

Here is the code I am using to display report.

Public CRReport As New CRAXDRT.Report
Public CRApp As New CRAXDRT.Application

Public Sub CrysRpt(CrytalOCX As Object, RptPath As String, DBPath As String, DBPassword As String)

'-Assign Path to Report
Set CRReport = CRApp.OpenReport(App.Path & RptPath)

On Error GoTo ExitLabel

With CRReport '-// Log-On to Database with Password Protect

'-//====================================
.Database.Tables(1).SetLogOnInfo App.Path & DBPath, App.Path & DBPath, "", DBPassword

End With

    With CrytalOCX

        'Set the source of Report viewer to the path of Report you made
        .ReportSource = CRReport

        'View/Display Report
        .ViewReport

    End With

    CRApp.CanClose

Exit Sub

ExitLabel:     MsgBox Err.Number & " " & Err.Description, vbCritical

End Sub

Calling Function to display report

On Error GoTo loaderr
Screen.MousePointer = vbHourglass
Call CrysRpt(CRViewer1, "\BanksInformation.rpt", "\My Bank.mdb", "asd987123")
CRReport.ParameterFields(1).AddCurrentValue (250)
Screen.MousePointer = vbNormal
Exit Sub
loaderr:
MsgBox Err.Description
Exit Sub
End Sub

I think I had to add some line to calling function which will filter the data. How do that?


IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum