craxdrt application and selection formula

I need to know what references I need in a vb application in order to use the craxdrt application.  I also need to know how to use a selection formula with the craxdrt?
tblockAsked:
Who is Participating?
 
mlmccConnect With a Mentor Commented:
As I recall the references are

Crystal Reports ActiveX Design and Runtime  - CRAXDRT.DLL
Crystal Viewer

To use the selection formula -  put this code on the CRViewer form.

Option Explicit
    Private crApp As CRAXDRT.Application
    Private crRpt As CRAXDRT.Report
'
'   Open report
'
    Set crApp = New CRAXDRT.Application

    Set crRpt = crApp.OpenReport(txtReportName, 1)
    crRpt.RecordSelectionFormula = "{Table.FieldName} = " & intVar.Value

'
'   Set flags for CRViewer
'
    crRpt.MorePrintEngineErrorMessages = False
    crRpt.EnableParameterPrompting = False
    crRpt.DiscardSavedData

'
' Set the viewer's report source to the Report object
'
    Me.rptCRViewer.ReportSource = crRpt
    Me.rptCRViewer.ViewReport
    Me.Show

mlmcc
0
 
vidruConnect With a Mentor Commented:
Add a reference to the Crystal Reports [version] ActiveX Designer Run Time Library.  If this is for CR 10 or XI, the name of the reference is different, but similar enough that you'll be able to find it.

The CRAXDRT.Report object has a RecordSelectionFormula property that you can set at runtime:

crxRpt.RecordSelectionFormula = "{Table.Field} = '" & txtString.Text & "'"

-dave
0
 
mlmccCommented:
My answer {13797389} or vidru's {13797408} should have helped.

mlmcc
0
 
mlmccCommented:
Glad i could help

mlmcc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.