Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Crystal Report.

I'm 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? I'm using OLEDB and connect to Access DB.

:( :( :(

Posted
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, don't ask how to make a report after the wizard is done, cause crystal and i don't get along.
  • 2 years later...
Posted

Crystal Reports in VB

 

Crystal Report.

I'm 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? I'm 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

Posted

Crystal Reports in VB

 

Crystal Report.

I'm 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? I'm 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

Posted
Crystal Report.

I'm 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? I'm 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?

> NeoDataType.net <

Try my Free .Net Reporting Tool!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...