Results 1 to 4 of 4

Thread: I am a noob to CR 9.0...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2005
    Location
    Litchfield, IL
    Posts
    22

    Post I am a noob to CR 9.0...

    Hello everyone,

    It has been years since I have used CR. The last version I was on was 8.5 I believe, maybe it was the intrinsic version that came with VB 4 or 5. Its been awhile, lets put it that way.

    My company just purchased CR 9.0 for me to use with VB 6.0. Can anyone point me to a place where I can find a simple tutorial of just dragging the CR control onto a form and then run a sql query for a pre-built report.

    All the samples that come with it, use the designer? Huh, I am not familiar with this at all. I just want to run some simple reports on the fly with sql queries. It really should not be this diffucult.

    Thanks.
    - ILJester

  2. #2
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381

    Re: I am a noob to CR 9.0...

    I design my reports outside the RDC. You can try something like this (I use SQL server SPROC to populate the report with data):

    VB Code:
    1. Option Explicit
    2.  
    3. Dim crxApplication As New CRAXDRT.Application
    4. Dim crxReport As CRAXDRT.Report
    5.  
    6. Private Sub Form_Load()
    7.    Set crxApplication = New CRAXDRT.Application
    8.    Set crxReport = crxApplication.OpenReport("C:\MyReport.RPT")
    9.    '-THIS IS FOR THE MAIN REPORT
    10.    With crxReport.Database.Tables(1).ConnectionProperties
    11.       .Item("Provider") = "SQL"
    12.       .Item("Data source") = "SRV"
    13.       .Item("Initial Catalog") = "NEW"
    14.       .Item("User ID") = "USER"
    15.       .Item("Password") = "USER"
    16.    End With
    17.    
    18.    
    19. '   crxReport.PrinterSetup (0) '<-- THIS BRINGS UP THE PRINTER DIALOGUE BOX
    20.    
    21.    CRViewer91.ReportSource = crxReport
    22.    CRViewer91.ViewReport
    23. End Sub
    24.  
    25. Private Sub Form_Resize()
    26.    With CRViewer91
    27.       .Top = 0
    28.       .Left = 0
    29.       .Width = Me.ScaleWidth
    30.       .Height = Me.ScaleHeight
    31.    End With
    32. End Sub
    33.  
    34. Private Sub Form_Unload(Cancel As Integer)
    35.    Set crxReport = Nothing
    36.    Set crxApplication = Nothing
    37. End Sub

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2005
    Location
    Litchfield, IL
    Posts
    22

    Re: I am a noob to CR 9.0...

    Hi there ARPRINCE. Thank you very much for the reply. I am kinda confused by a couple things though :

    When you say you 'design your reports outside the RDC', does that mean you design from within CR application itself? I am assuming this is the case, and you use the database connection to build the report in design mode.

    Also, I was kinda confused by you saying you were using an SPROC. I dont see the SPROC named anywhere in your example code, or is it just embedded in the report at design time? Or is this line for it -
    VB Code:
    1. With crxReport.Database.Tables(1).ConnectionProperties

    I am kinda confused on the Tables(1) part.
    I am not sure how I would pass parms if that is the case.

    Anyways, thanks for the response.
    - ILJester

  4. #4
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381

    Re: I am a noob to CR 9.0...

    Quote Originally Posted by ILJester
    When you say you 'design your reports outside the RDC', does that mean you design from within CR application itself? I am assuming this is the case, and you use the database connection to build the report in design mode.
    YES
    Quote Originally Posted by ILJester
    Also, I was kinda confused by you saying you were using an SPROC. I dont see the SPROC named anywhere in your example code, or is it just embedded in the report at design time?
    YES

    Try this one...

    Quote Originally Posted by ILJester
    I am not sure how I would pass parms if that is the case.
    Once you call the report from within your VB application, the report opens up a parameter pop-up automatically.

    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