|
|
|
|
|
The Microsoft
Visual Basic .Net member of the Microsoft Visual Studio .Net |
|
crystall report
specific application ..., describe how to use Microsoft Visual Basic .Net to
create Report - (Crystal Report)
The Classes
used in this application
OleDbConnection, OleDbDataAdapter, OleDbCommand, CrystalReportViewer, DataSet, Label, TextBox
and Button
- Name -
crystall report
specific.
- Report
Software.
- Developed with
Microsoft Visual Basic .Net.
- Functions ...
- Requirements:
Microsoft Visual Studio .Net.
If you want to run it:
- Remove the
read-only attribute of all files in the
folder - C:\crystall report
specific
- Run the
Microsoft Visual Studio .Net.
- From
File menu, choose Open,
choose Project ..., the
Open Project dialog box appears,
select the project file crystall report
specific.vbproj -
(C:\crystall report
specific\crystall report
specific.vbproj)
and then click Open.
- From
Debug menu, choose and click
Start.
|
Project - crystall report
specific
and those items
|
1. Create new Visual Basic
.Net
project
Run Microsoft Visual Studio
.Net. On the
File menu , click New, and then click Project
.... The New Project dialog box appears.
- In the Project
Types pane, select the Visual Basic Projects
folder.
- In the Templates
pane, select Windows Application icon (project
type). A message appears indicating the type of project you
are going to create - (A project for creating an application
with a Windows user interface).
- In the Name
box, type
crystall report
specific.
- In the
Location box, type
C:\
- Click
OK.
The
Windows Application create all necessary files and
opens the Visual Basic .Net project -
crystall report
specific.
|
2.
DataSet
- On the View menu ,
click Solution Explorer
- In Solution Explorer,
right click the
crystall report
specific, select Add on the shortcut
menu to open other shortcut menu, click Add New Item, the
Add New Item -
crystall report
specific dialog box appears.
- In the Add New Item
-crystall report
specific
dialog box:
- In the Categories
pane, select Local Project Items
- In the Templates
pane, select DataSet . A message appears - (A file
creating an XML schema with DataSet classes).
- In the Name
box, type Dataset1.xsd
- Click Open
New blank DataSet
created
Generate Dataset ...
From the
Toolbox/Data, add OleDbDataAdapter
control to the Form1.vb
design. Data Adapter Configuration Wizard dialog box
appears.
- In the 1st page of
this dialog, click Next
- In the 2nd page,
click New Connection, the Data Link Properties dialog box appears.
- In the Provider tab
of the Data Link Properties dialog box, select Microsoft
Jet 4.0 OLEDB Provider and then click Next
- In the Connection tab,
in the Select or enter a database name box type
C:\crystall report
specific\KJV2002.mdb and
then click Ok
|
and then click Next.
- In the 3th page,
select Use SQL statements radio button and then click Next.
- In the 4th page,
type in the What data should ... box : SELECT Book,
BookTitle, Chapter, Verse FROM BibleTable ORDER BY Book, Chapter,
Verse and then click
Next
- In the 5th page, click Finish.
New OleDbConnection control
displays in the Form1.vb
|
in
the Form1.vb, Right click the OleDbDataAdapter
control,
select and click Generate Dataset on the shortcut menu,
the Generate Dataset dialog box appears:
- Select Existing
radio button
- Select
crystall_report_specific.DataSet1in the combobox
- Check Bibletable
check box, in the Choose which table ... box.
- Check Add this dataset
to the design check box
- and then click Ok.
New DataSet control
displays in the Form1.vb
|
The
DataSet design
|
|
|
|
1. |
|
Create Crystal Report,
CrystalReport1.rpt
On the
View menu , click Solution
Explorer
In
Solution Explorer, right click the
crystall report specific, select Add
on the shortcut menu to open other shortcut menu,
click Add New Item, the Add New
Item - crystall report specificdialog box
appears.
In
the Add New Item -crystall report
specific dialog box:
In the
Categories pane, select Local Project
Items
In the
Templates pane, select Crystal Report
icon . A message appears - (A Crystal
Report file that publishes data to a windows or
Web form).
In the
Name box, type
CrystalReport1.rpt
Click
Open
If
Crystal Decisions registration wizard
dialog box appears, click Register Later
Crystal
Report
Gallery
dialog box appears, in this dialog
select Using the Report Expert radio
Button, from Choose an Expert, select
Standard and then click Ok.
Standard Report Expert dialog box appears
In
Standard Report Expert dialog box, select
the following Tabs :
In the
Tab - Data, from Available data
sources pane, expand Report Data,
expand ADO Net DataSets, expand
crystall_report_specific.DataSet1, select
BibleTable, click Insert table, in
Tables in report appears BibleTable.
In the Tab -
Fields, in the Available Fields pane,
expand Dataset1 (ADO .Net (XML)), expand
BibleTable:
Select Book, click Add, in the
Fields to Display pane, display
BibleTable.Book, in Column Heading box
display Book.
Select BookTitle, click Add, in
the Fields to Display pane, display
BibleTable.BookTitle, in Column Heading
box display BookTitle.
Select Chapter, click Add, in
the Fields to Display pane, display
BibleTable.Chapter, in Column Heading
box display Chapter.
Select Verse, click Add, in the
Fields to Display pane, display
BibleTable.Verse, in Column Heading box
display Verse.
In the Tab -
Chart
Select the
Tab - Type, select Automatically set
chart options check box, in the
Chart pane, select Pie icon, click
button Multiple pie chart
Select the Tab - Data:
Choose and select One per report from
Place chart combobox, select Header
radio button,
in the Layout section select Advanced view
In the Data section, in the combobox select
On change of, in the Available
fields pane, expand Report Fields,
select and add Bibletable.Book (in the box
display Bibletable.Book - A), , select and
add Bibletable.Chapter (in the box display
Bibletable.Chapter - A)
Expand Dataset1 (ADO .Net (XML)),
expand BibleTable, select and add Book
(in the box display Count of Bibletable.Book),
, select and add Chapter (in the box
display Count of Bibletable.Chapter)
then clcik Finish. |
|
In the Windows, new
Crystal Report design appears and new
Crystal Report file to be added to the current project
|
|
The CrystalReport1.rpt
design
|
|
2. |
The CrystalReport2.rpt
design
Data
Source =
crystall_report_specific.DataSet1
Table = BibleTable.
Chart = 3D Riser
|
|
After runnig, the following designs
display:
|
1. |
The View design
|
2. |
This Form includes the following
controls:
One OleDbConnection control, one OleDbDataAdapter control, one DataSet control, one CrystalReportViewer
control, one Label control,
tree TextBox control
and five Button controls.
The
Functions ...
Select
the Button Crystal Report 1, the Crystal
Report - CrystalReport1.rpt is active.
Select the
Button Crystal Report 2, the Crystal Report
- CrystalReport2.rpt is active.
Select the
Button Variable Fixed, the Crystal Report
data displays corresponding to the values of
the Field Book = "03".
Select the
Button Variable = Input Value, the Crystal
Report data displays corresponding to the
values of the Field Book
= the Input Value in the TextBox.
Select the
Button Input value 1 < Variable < Input value 2,
the Crystal Report data displays corresponding to
the values of the Field Book
>= the Input Value in the1st TextBox
and the values of the Field Book
<= the Input Value in the2nd TextBox.
|
3. |
The
Codes ...
|
| |
|
|