Results 1 to 11 of 11

Thread: Crystal Reports 10.0 in VB6?

  1. #1

    Thread Starter
    Fanatic Member Avatarp's Avatar
    Join Date
    Sep 2002
    Location
    Calgary
    Posts
    826

    Crystal Reports 10.0 in VB6?

    I have Crystal Reports Professional 10.0. Shouldn't I have the designers in VB6 available? They are there. Is CR10 not compatible for VB6 developers?

  2. #2

    Thread Starter
    Fanatic Member Avatarp's Avatar
    Join Date
    Sep 2002
    Location
    Calgary
    Posts
    826

    I see that this wuestion has been asked before

    However there are no reponses to any of those questions. Should I infer that Crystal Reports 10 isn't compatible with VB6 or that nobody in vb forums knows anything about Crystal Reports 10?

  3. #3
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    I will be going to CR10 in the 1st quarter. I assume that it works. I haven't heard otherwise. I'm not sure what you mean by the "designers". I design my reports in CR and then invoke them in VB code.

  4. #4

    Thread Starter
    Fanatic Member Avatarp's Avatar
    Join Date
    Sep 2002
    Location
    Calgary
    Posts
    826

    in 8.5

    You could desing the Crystal Report in VB6 Studio with the wizard or from an existing report. However in 10.0 as I have it There are no tools for VB6 Developers. I can bring in the ActiveX Report Viewer into my project but I can not change anything with the design graphically. I haven't even been able to connect to an existing report.

    I need to get Crystal Reports 8.5 I think....any ideas?

  5. #5
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    Crystal changed a bunch (in how to use it in VB) with 8.5 or 9.0 , I can't remember.

    In 9.0 you need this in your general declarations (of the form)

    Dim crxApplication As New CRAXDRT.Application
    Public Report As CRAXDRT.Report
    Dim crxDatabaseTable As CRAXDRT.DatabaseTable

    Then, when I invoke the report:

    Set Report = crxApplication.OpenReport("Z:\DAD\DailyProductionQuickSummary.rpt", 1)
    For Each crxDatabaseTable In Report.Database.Tables
    crxDatabaseTable.ConnectionProperties("user id") = "sa"
    crxDatabaseTable.ConnectionProperties("Password") = myPasswordTechniSQL
    Next crxDatabaseTable
    Report.SelectPrinter glbPrinterDriver, glbPrinterName, glbPrinterPort
    Report.PaperOrientation = crDefaultPaperOrientation
    If glbPrinterDestination = 0 Then 'to screen
    glbReportForm = "frmProduction"
    CRViewer.Show vbModal
    Else
    Report.PrintOut False
    End If

  6. #6

    Thread Starter
    Fanatic Member Avatarp's Avatar
    Join Date
    Sep 2002
    Location
    Calgary
    Posts
    826

    how about for Crystal 10

    How do I get this working for Crystal Reports 10. There is no CRAXDRT available.

  7. #7
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    Again, I am not planning to go to 10 until late 1st quarter. I guess i will figure it out then.

  8. #8
    Addicted Member
    Join Date
    Jul 2003
    Location
    Lewiston, Maine
    Posts
    128
    If you have Crystal Reports Developer 10 then you can create your reports right in VB6. These reports are enbedded into your project. Under the projects menu you will find the: Add Cryatal Reports 10 Wizard. If you have Crystal Reports Professional 10 then you can't design your reports in the VB6 IDE.

  9. #9

    Thread Starter
    Fanatic Member Avatarp's Avatar
    Join Date
    Sep 2002
    Location
    Calgary
    Posts
    826

    Thanks anyways

    At least this post got some response

  10. #10

    Thread Starter
    Fanatic Member Avatarp's Avatar
    Join Date
    Sep 2002
    Location
    Calgary
    Posts
    826

    purdybirds

    I have Pro...guess that is no good. Thanks!

  11. #11

    Thread Starter
    Fanatic Member Avatarp's Avatar
    Join Date
    Sep 2002
    Location
    Calgary
    Posts
    826

    Re: Crystal Reports 10.0 in VB6?

    I now have Crystal Reports Developer 10. I am testing my code now and I am getting an error when my Report tries to access the database for the report. My database is Access and password protected. This used to work fine for 8.5 but my method must be incorrect now or Crystal Reports 10 doesnt support DAO.

    Any help:

    here is my code behind the form

    Code:
    Dim Report As New CR10ClientBirthday
    
    Private Sub Form_Load()
    On Error GoTo MyErrorTrap:
    
        Me.WindowState = vbMaximized
    
        ' Add the datasource to the report
        Set Report = Nothing
        Set Report = New CR10ClientBirthday
    
        'sets the database password enabling the report to connect
        Report.Database.Tables(1).SetSessionInfo "", Chr(10) & HSODBpswrd
        'Sets the location for the first table in the report to the Access database.  If the report has
        'more than one table the same location will propagate through all of the tables.
        'You can set a new location for each table individually based on it's index in the Tables collection.
        Report.Database.Tables(1).Location = HSO_DB_PATH_AND_NAME
    
        Screen.MousePointer = vbHourglass
        CRViewer1.ReportSource = Report
        CRViewer1.ViewReport
        Screen.MousePointer = vbDefault
        Exit Sub
    MyErrorTrap:
        MsgBox Err.Description, vbOKOnly
    End Sub
    
    Private Sub Form_Resize()
        CRViewer1.Top = 0
        CRViewer1.Left = 0
        CRViewer1.Height = ScaleHeight
        CRViewer1.Width = ScaleWidth
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        Set Report = Nothing
    End Sub

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