Crystal Report

darkpl

New member
Joined
Aug 6, 2003
Messages
2
Crystal Report.
Im new to VB.Net, i know there is a new features - Crystal Report. Can anyone give me an example how to create and show (say, a button press) a report using Crystal Report? Im using OLEDB and connect to Access DB.
:( :( :(
 
crystal in vb is nothing new, if you have VS.NET there is a report wizard, just drop your db connection onto a form and the report generator will pretty much take care of the rest, dont ask how to make a report after the wizard is done, cause crystal and i dont get along.
 
Crystal Reports in VB

darkpl said:
Crystal Report.
Im new to VB.Net, i know there is a new features - Crystal Report. Can anyone give me an example how to create and show (say, a button press) a report using Crystal Report? Im using OLEDB and connect to Access DB.
:( :( :(


Here is the easiest way I know:

1. Create your Crystal report and save it...you will need the full path and report name (example: X:\CrystalReports\MyReport.rpt ).

2. Create a New Standard EXE VB project and, in Project References, check the boxes for:
Crystal Report Viewer Control 9
Crystal Reports 9 ActiveX Designer Design and Runtime Library
Crystal Reports 9 ActiveX Designer Run Time Library

3. In Project Components, checkmark the box for Crystal Report Viewer Control 9.

4. Create two forms...name one frmMain and the other frmCrystal.

5. On frmMain, create a Command button for your report...double click it and put frmCrystal.Show as the code

6. On frmCrystal, double-click the CRViewer9 icon (on the General Toolbar) to put the viewer on the form (it will default name it CRViewer91 . You should set WindowState to Maximized.

7. Right-click on the form, click VIEW CODE and paste this code:

Private Sub Form_Load()
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
CRViewer91.Top = 0
CRViewer91.Left = 0
CRViewer91.Height = 12336
CRViewer91.Width = 15408
Set Report = Appl.OpenReport("X:\CrystalReports\MyReport.rpt")
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
End Sub

8. You can put a Command button on this form called Exit and paste Unload Me in it to return to frmMain.

9. This should do the trick...the great thing is you can edit the Crystal Report without opening VB and it does not overload the VB project with all your CR forms.

Run it and enjoy.
TomShark :D
 
Crystal Reports in VB

darkpl said:
Crystal Report.
Im new to VB.Net, i know there is a new features - Crystal Report. Can anyone give me an example how to create and show (say, a button press) a report using Crystal Report? Im using OLEDB and connect to Access DB.
:( :( :(


Here is the easiest way I know:

1. Create your Crystal report and save it...you will need the full path and report name (example: X:\CrystalReports\MyReport.rpt ).

2. Create a New Standard EXE VB project and, in Project References, check the boxes for:
Crystal Report Viewer Control 9
Crystal Reports 9 ActiveX Designer Design and Runtime Library
Crystal Reports 9 ActiveX Designer Run Time Library

3. In Project Components, checkmark the box for Crystal Report Viewer Control 9.

4. Create two forms...name one frmMain and the other frmCrystal.

5. On frmMain, create a Command button for your report...double click it and put frmCrystal.Show as the code

6. On frmCrystal, double-click the CRViewer9 icon (on the General Toolbar) to put the viewer on the form (it will default name it CRViewer91 . You should set WindowState to Maximized.

7. Right-click on the form, click VIEW CODE and paste this code:

Private Sub Form_Load()
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
CRViewer91.Top = 0
CRViewer91.Left = 0
CRViewer91.Height = 12336
CRViewer91.Width = 15408
Set Report = Appl.OpenReport("X:\CrystalReports\MyReport.rpt")
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
End Sub

8. You can put a Command button on this form called Exit and paste Unload Me in it to return to frmMain.

9. This should do the trick...the great thing is you can edit the Crystal Report without opening VB and it does not overload the VB project with all your CR forms.

Run it and enjoy.
TomShark :D
 
darkpl said:
Crystal Report.
Im new to VB.Net, i know there is a new features - Crystal Report. Can anyone give me an example how to create and show (say, a button press) a report using Crystal Report? Im using OLEDB and connect to Access DB.

Just a question.

Why when you need a report you say "Crystal Report", also if it is (in my opinion) the worse tools all around?
 
Back
Top