Results 1 to 16 of 16

Thread: [RESOLVED] how to add crystal report xi into vb6

Threaded View

  1. #16
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: how to add crystal report xi into vb6

    Add ref to ....
    Code:
    Crystal reports ActiveX Designer Runtime Library 11.0
    Crystal reports ActiveX Designer Design and Runtime Library 11.0
    make the form & viewer large enough.
    In the project explorer of vb you should see CrystalReport1. click it you should see the same things as a normal CR Form (Database, special fields etc). Manipulate them as you like...

    There is another easy method. Simply make a report as per your requirements. In the form where you just placed the viewer add this code..
    Code:
    Dim appln As New CRAXDDRT.Application
    Dim Report As New CRAXDDRT.Report
    Private Sub Form_Load()
        Me.Top = 0
        Me.Height = MDI1.Height
        Me.Left = (MDI1.Width - Me.Width) \ 2
        
        Screen.MousePointer = vbHourglass
        Set Report = appln.OpenReport(App.Path & "yourreport.rpt")
        Report.Database.Tables(1).Location = App.Path & "\yourdb.mdb"
        Report.Database.Tables(1).ConnectionProperties("Database Password") = "yourpassword"
        CRViewer.ReportSource = Report
        CRViewer.ViewReport
        CRViewer.Zoom (100)
        Screen.MousePointer = vbDefault
    
    End Sub
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
        Set Report = Nothing
        Set appln = Nothing
    End Sub
    
    Private Sub Form_Resize()
    CRViewer.Top = 0
    CRViewer.Left = 0
    CRViewer.Height = ScaleHeight
    CRViewer.Width = ScaleWidth
    
    End Sub
    Last edited by VBFnewcomer; Apr 9th, 2008 at 12:47 AM.

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