Add ref to ....
make the form & viewer large enough.Code:Crystal reports ActiveX Designer Runtime Library 11.0 Crystal reports ActiveX Designer Design and Runtime Library 11.0
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




Reply With Quote