Sample Database for running Crystal Reports tutorials

In the subsequent section, you will be guided through the process of creating a sample database, along with its respective tables and data, which will serve as the foundation for running the Crystal Reports Tutorials. It is important to note that all examples featured in the VB.NET Crystal Reports Tutorials are built upon this specific database.

To initiate the process, the first step entails creating the database itself. Assign the name "crystaldb" to this database, ensuring a unique and identifiable designation.

Create a DataBase "crystaldb"

In the crystaldb database , create three tables.

  1. OrderMaster
  2. OrderDetails
  3. Product

OrderMaster

  1. OrderMaster_id
  2. OrderMaster_date
  3. OrderMaster_customer
  4. OrderMaster_createduser

OrderDetails

  1. OrderDetails_id
  2. OrderDetails_masterid
  3. OrderDetails_productid
  4. OrderDetails_qty

Product

  1. Product_id
  2. Product_name
  3. Product_price

The following picture shows the relations of each table :

crytal_report_table_relations.JPG

SQL command for creation tables are follows :

CREATE TABLE [dbo].[OrderMaster] ( [OrderMaster_id] [int] NOT NULL , [OrderMaster_date] [datetime] NULL , [OrderMaster_customername] [varchar] (50), [OrderMaster_createduser] [varchar] (50) ) ON [PRIMARY]
CREATE TABLE [dbo].[OrderDetails] ( [OrderDetails_id] [int] NOT NULL , [OrderDetails_masterid] [int] NULL , [OrderDetails_productid] [int] NULL , [OrderDetails_qty] [int] NULL ) ON [PRIMARY]
CREATE TABLE [dbo].[Product] ( [Product_id] [int] NOT NULL , [Product_name] [varchar] (50) , [Product_price] [numeric](18, 0) NULL ) ON [PRIMARY]

Enter data to the tables :

Order Master Table Data

crytal_report_ordermaster_data.JPG

Order Details Table Data

crytal_report_orderdetails_data.JPG

Product Table Data

crytal_report_product_data.JPG