Results 1 to 4 of 4

Thread: RE: VB & CRYSTAL REPORT --TO QUERY ACCESS TABLE ??? STUCK !!!

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    39
    You can use the Selection Formula of the Crystal Report.
    ThOmaS TaN

  2. #2
    New Member
    Join Date
    Aug 2000
    Location
    Kolhapur
    Posts
    3
    If you are using Crystal Report's OCX Control check with its selection criteria property which can be set within Visal Basic. For more help check on Developers.hlp in crystal directory.

    Indraneel
    Indraneel

  3. #3
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    I always create a separate table for reporting, so I can format it the way I want. If you create a new table for this report, then you can clear the table, and fill it only with the records you need for the report.

    Hope this helps,

  4. #4
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Sudbury, Ontario, Canada
    Posts
    274
    I think the easiest way is to set your report datasource to a recordset that you create.

    Such as:
    Code:
        Dim rstCurrent As ADODB.Recordset
        Dim strSql As String
        Dim Report1 As rptClient
    
        Screen.MousePointer = vbHourglass
        
        strSql = "SELECT * FROM client WHERE lastname = 'Smith' ORDER BY firstname"
        
    'Load a form with the reportviewer control on it.
    
        Load frmReport
    
    'open your recordset
    
        Set rstCurrent = New ADODB.Recordset
        rstCurrent.Open strSql, fCnn1, adOpenForwardOnly, , adCmdText
    
    'load your report
    
        Set Report1 = New rptClient
    
    'set your report's datasource
    
        Report1.Database.SetDataSource rstCurrent
    
        frmReport.crvCommon.ReportSource = Report1
    
        frmReport.crvCommon.ViewReport
    
        frmReport.crvCommon.Visible = True
    
        frmReport.Show
        
        Screen.MousePointer = vbDefault
    Hope this helps.

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