Results 1 to 6 of 6

Thread: Why is it the query doesnt work

Hybrid View

  1. #1

    Thread Starter
    Member psychofoo's Avatar
    Join Date
    Jun 2005
    Posts
    48

    Re: Why is it the query doesnt work

    can u tell me how u display ur query in Crystal?

  2. #2
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918

    Re: Why is it the query doesnt work

    Up until very recently I used the Crystal API for reporting, but am now starting to use theCrystal RDC and the Report Viewer. I use 'Selection Formulas' rather than queries, similar to the following:
    VB Code:
    1. Option Explicit
    2.  
    3. Dim Report As New CrystalReport1
    4. Dim crProp As CRAXDRT.ConnectionProperties
    5.  
    6. Private Sub Form_Load()
    7.  
    8.     Screen.MousePointer = vbHourglass
    9.    
    10.     Set crProp = Report.Database.Tables(1).ConnectionProperties
    11.     crProp.Item("Database Name") = App.Path & "\mydb.mdb"
    12.     crProp.Item("Database Password") = "mypassword"
    13.    
    14.     [color=red]Report.RecordSelectionFormula = "{mytable.myfield}='condition'"[/color]
    15.    
    16.     CRViewer91.ReportSource = Report
    17.     CRViewer91.ViewReport
    18.     Screen.MousePointer = vbDefault
    19.  
    20. End Sub
    So I guess your query would look something like:
    VB Code:
    1. Report.RecordSelectionFormula = "{tCommission.contno} Like '%" & NContNo & "%'"
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

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