Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Visual Training
Of
Day 8
In todays session: Why reports are needed for the Business Success Crystal Report Creating First Crystal Report Attaching Report to a web form
So, the reports are used for this purpose. A very useful reporting tool is available with the Visual Studio 2005. This tool is freely available in it. It is called Crystal Report.
A Report can be developed based on any of the following database objects: Table Views Stored Procedures (SPS) Lets see how to design and develop these reports and how to incorporate these reports into our web applications. For this we have to do the following tasks:
1. Creating View or Stored Procedure on which our Report will be based 2. Creating a Report based on this View or SPS 3. Designing a Form that will display the designed/developed report 4. Modifying the web.config file 5. Running the Report
Here, we create our crystal report from a View: the steps are described below, A view is logical table, which can be used to pull the data from the multiple tables.
Suppose we have the following table structure, the table name is tblEmployee tblEmployee (EmployeeSID, EmployeeName, FatherName, Gender, QualificationSID, DateOfBirth) & tblQualification
The QualificationSID is a foreign Key and its values is determined from the tblQualificatin, and its structure is show here
Now, you will see the dialogue listing all of your database tables,
Add the tblEmployee and tblQualifiaction tables one by one for your view and press the Close button. This will provide the following output:
The two tables are connected as you have defined the Primary-Foreign Key relationship between these two tables. Similar to tblQualification, you add other tables e.g. tblReligion, tblSect, tblCaster, tblDepartment etc for more detailed report.
Our Aim: Spread Knowledge with every single bit
Now, Right Click the line between the two tables and select the option as shown,
This will ensure all of the employee data will be pulled out, although their qualification details have not be entered. Select the column, that is required for the Report
Press the Execute Button, the result of the View will be displayed, as shown,
Save it,
View_Employee_Details