CSharp.Net-Informations.com
   Home      .Net Framework      VB.NET      C#                                                                      About


  C# Crystal Reports sample databse

For generating Crystal Reports from C# , we need to connect a database and some tables with data. In the following section you can see how to create a sample Database and Tables and the data for running of the following Crystal Reports - C# Tutorial . All examples in the CSharp Crystal Reports Tutorial is based on the following database .

First we have to create a database named it as "crystaldb"

Create DataBase "crystaldb"

In the crystaldb database , create three tables

OrderMaster , OrderDetails , Product .

The Table Structure follows :

  OrderMaster
	OrderMaster_id
	OrderMaster_date
	OrderMaster_customer

OrderMaster_createduser

  OrderDetails
	OrderDetails_id
	OrderDetails_masterid
	OrderDetails_productid

OrderDetails_qty

  Product
	Product_id
	Product_name

Product_price

The following picture shows the relation of tables in crystaldb database :

csharp-crystal-report-table-relations

SQL command for creating 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 some data to the tables :

From the following pictures you can see some data in the table for C# - Crystal Reports tutorial

Order Master Table Data

csharp-crystal-report-ordermaster-data

Order Details Table Data

csharp-crystal-report-orderdetails-data

Product Table Data

csharp-crystal-report-product-data
        
        
C# Tutorial




C# Crystal Reports Related Contents
*     C# Crystal Reports step by step
*     C# Crystal Reports from multiple tables
*     C# Crystal Reports String parameter
*     C# Crystal Reports Integer parameter
*     C# Crystal Reports Date parameter
*     C# Crystal Reports Dynamic Logon parameters
*     C# Crystal Reports Formula Field
*     C# Crystal Reports Summary Field
*     C# Crystal Reports Export to Pdf
*     C# Crystal Reports Export to Excel
*     Email Crystal Reports from C# Application
*     C# Crystal Reports without database
*     C# Crystal Reports from SQL Query
*     Dynamic Crystal Reports from C# Application
*     C# Crystal Reports from XML
*     C# Crystal Reports - sub reports
*     C# Crystal Reports - on demand sub reports
*     C# Crystal Reports - Date to Date
*     How to print Crystal Reports in C#
*     How to deploy Crystal Report
*     How to Crystal Report Merge Module
*     5 Tests for Top Performance by Jason Dove
*     3 New Uses For Sub Reports by Jason Dove


   Home      VB.NET      C#
CSharp Related Topics
*     An overview of Microsoft CSharp
*     C# Language Tutorial
*     C# Statements Tutorial
*     C# Collection Tutorial
*     C# String Tutorial
*     C# File Operations Tutorial
*     C# Excel Tutorial
*     C# Crystal Reports Tutorial
*     CSharp Communication Tutorial
*     C# Ado.Net Tutorial and Source Code
*     C# ADO.NET data Providers Tutorial
*     C# Dataset Tutorial
*     C# DataAdapater Tutorial
*     Csharp DataView Tutorial
*     Csharp Remoting Tutorial
*     C# XML Tutorial
*     C# DataGridView Tutorial
   Home      VB.NET      C#
More Source Code :   
Mail to :  feedback@net-informations.com
  |  Home   |  VB.NET   |  C#   |  SiteMap   |  Terms of Use   |  About   |
net-informations.com (C) 2010
All Rights Reserved. All other trademarks are property of their respective owners.