Results 1 to 2 of 2

Thread: [Self-RESOLVED] Creating a Report using CR 9

Threaded View

  1. #1

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Resolved [Self-RESOLVED] Creating a Report using CR 9

    Hi! I have a form which has two DTPicker and a listview. The listview display a record based on the startdate and enddate of the DTPicker. After the records are displayed, A button will be click to open another form (frmViewSalesRpt) which has a crviewer in it.

    My Question is how do i pass the records of the listview to the crviewer?
    or is there other way to do it?
    Here's my code:
    VB Code:
    1. Private Sub Form_Load()
    2.   Call openConnection
    3.   Me.Left = 2640
    4.   Me.Top = 325
    5.  
    6.   sSQL = "SELECT * FROM TblSales"
    7.    
    8.   Set oRsSales = New ADODB.Recordset
    9.   Set oRsSales = oConn.Execute(sSQL)
    10.   Set oApp = New CRAXDRT.Application
    11.   Set oReport = oApp.OpenReport(App.Path & "\Reports\Sales.rpt", 1)
    12.   oReport.Database.SetDataSource oRsSales, 4, 1
    13.   CRViewer91.ReportSource = oReport
    14.   CRViewer91.ViewReport
    15. End Sub
    Right now my code (from RobDog888) will display the whole database records not the records specified/displayed in the listview.
    Last edited by Simply Me; May 11th, 2006 at 06:13 AM.
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

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