Results 1 to 3 of 3

Thread: multiple reports CR9 viewer

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006
    Posts
    977

    multiple reports CR9 viewer

    Hi
    I have a CR9 viewer inside my VB6 form ,the back end is Access 2003.
    I am using the following SQL to view a report corresponding to BID=24(it's the primary key)

    VB Code:
    1. SQL="SELECT Btest.*, BOrigin.*, BDestination.*, Btest.BID"
    2. SQL= SQL & " FROM (Btest INNER JOIN BOrigin ON Btest.BOriginID = BOrigin.BOriginID) INNER JOIN BDestination"
    3. SQL=SQL & " ON Btest.BDestinationID = BDestination.BDestinationID WHERE (((Btest.BID)=24))"
    4.  
    5.  
    6. rs6.Open SQL, cn, adOpenKeyset, adLockPessimistic
    7.  
    8. Set oApp = New CRAXDRT.Application
    9.     Set oReport = oApp.OpenReport(App.Path & "\Report3.rpt", 1)
    10.     oReport.Database.SetDataSource rs6, 3, 1
    11.     frmreport.crvMyCRViewer.ReportSource = oReport
    12.     frmreport.crvMyCRViewer.ViewReport
    13.     frmreport.crvMyCRViewer.Refresh
    14.     frmreport.Show 1
    15. rs6.Close
    But the report instead of giving me the report corresponding to 24(the ID of the record),returns to me 63 reports.
    I tried the SQl query in my Database access(I run the query corresponding to SQL) and it returned to me a single record(the correct answer)
    What's wrong?
    Please help me it's very urgent
    thanks
    Last edited by engnouna; Aug 7th, 2006 at 01:24 PM.

  2. #2
    Addicted Member mabbas110's Avatar
    Join Date
    Oct 2005
    Location
    Karachi , Pakistan
    Posts
    172

    Re: multiple reports CR9 viewer

    ok u put the following code in it also

    CRV.SelectionFormula = "{BTEST.BID}=24"

    i hope this will solve ur problem
    Thanks and Regards,

    Muhammad Abbas

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006
    Posts
    977

    Re: multiple reports CR9 viewer

    thanks mabbas

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