Vb net xp_08

423 views
376 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
423
On SlideShare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Vb net xp_08

  1. 1. Creating ReportsObjectivesIn this lesson, you will learn to:Identify the need for generating Crystal ReportsIdentify the Crystal Report Data Access modelsCreate a Crystal Report for a Windows Form applicationHost a Crystal Report in a Windows applicationEnhance the Crystal Report presentation ©NIIT Creating Reports/Lesson 8/Slide 1 of 26
  2. 2. Creating ReportsCrystal ReportIs the standard reporting tool for Visual Studio .NET used to display summarized data.Needs database drivers to connect with the data source for accessing data.Supports two methods to access data from a data source: The Pull model The Push model ©NIIT Creating Reports/Lesson 8/Slide 2 of 26
  3. 3. Creating ReportsProblem Statement 8.D.1The Sales Manager of Diaz Telecommunications needs toview a report containing the order details and the summarizedrevenue for each month. The data should be presented insuch a way that it can be analyzed easily. ©NIIT Creating Reports/Lesson 8/Slide 3 of 26
  4. 4. Creating ReportsTask ListIdentify the data that needs to be displayed in the Crystal Report and the format in which the data is to bedisplayed.Identify the method to create a Crystal Report.Identify the method to enhance the Crystal Reportpresentation.Identify the method to host Crystal Report in a Windowsapplication.Create a Crystal Report for Windows application.Host the Crystal Report in the Windows application.View the Crystal Report. ©NIIT Creating Reports/Lesson 8/Slide 4 of 26
  5. 5. Creating ReportsTask 1: Identify the data that needs to be displayedin the Crystal Report and the format in which thedata is to be displayed.Result:As per the given problem statement, the data to bedisplayed in the Crystal Report is as follows: Date Inv CustID ProdID Cost Advance ©NIIT Creating Reports/Lesson 8/Slide 5 of 26
  6. 6. Creating ReportsTask 2: Identify the method to create a CrystalReport.You can create a Crystal Report by using three methods: Manually Using Standard Report Expert From an existing reportResult: You will create the Crystal Report by using the Standard Report Expert since it involves minimum steps. ©NIIT Creating Reports/Lesson 8/Slide 6 of 26
  7. 7. Creating ReportsTask 3: Identify the method to enhance the CrystalReport presentation.The presentation quality of a Crystal Report can beenhanced by adding the following components to theCrystal Report: Chart ® Allows easy analysis of the presented data. ® Is created to present summarized fields. Cross-Tab object ® Isa grid and is inserted in a Crystal Report when the data is to be displayed in form of compact rows, columns, and summary fields. ® Helps in comparing and identifying trends. ©NIIT Creating Reports/Lesson 8/Slide 7 of 26
  8. 8. Creating ReportsTask 3: Identify the method to enhance CrystalReport presentation. (Contd.)Result:Since the data is to be used for analysis purposes, youneed to insert a chart in the Crystal Report. ©NIIT Creating Reports/Lesson 8/Slide 8 of 26
  9. 9. Creating ReportsTask 4: Identify the method to host the CrystalReport in a Windows application.A Crystal Report can be hosted in a Windows Form byusing the Windows Forms Viewer.Windows Forms Viewer Is present as a control in the Toolbox. Can be inserted into a Windows application by dragging the CystalReportViewer control from the Toolbox into the form. Can interact with other controls on the Windows Form.Result:You will use the Windows Forms Viewer to deliver theCrystal Report in the Windows application. ©NIIT Creating Reports/Lesson 8/Slide 9 of 26
  10. 10. Creating ReportsTask 5: Create a Crystal Report for the Windowsapplication.Task 6: Host the Crystal Report in the Windowsapplication.Task 7: View the Crystal Report. ©NIIT Creating Reports/Lesson 8/Slide 10 of 26
  11. 11. Creating ReportsProblem Statement 8.D.2The Sales Manager of Diaz Telecommunications needs toview a summarized report containing the order details for theproducts with sale price greater than $3000 to identify thepotential market for the products in the coming period. Inaddition, the Sales Manager also needs to view thepercentage of the sale price paid as advance for each order. ©NIIT Creating Reports/Lesson 8/Slide 11 of 26
  12. 12. Creating ReportsTask ListIdentify the data that needs to be displayed in the Crystal Report and the format in which the data is to bedisplayed.Identify the method to create a Crystal Report.Identify the method to host Crystal Report in a Windowsapplication.Retrieve the filtered data from the database.Create a Crystal Report for Windows application.Host the Crystal Report in the Windows application.Write the code to connect to the database.View the Crystal Report from the Windows Forms Viewer. ©NIIT Creating Reports/Lesson 8/Slide 12 of 26
  13. 13. Creating ReportsTask 1: Identify the data that needs to be displayedin the Crystal Report and the format in which thedata is to be displayed.Result:As per the given problem statement, the data to bedisplayed in the Crystal Report is as follows: ProdID Inv Date CustID ©NIIT Creating Reports/Lesson 8/Slide 13 of 26
  14. 14. Creating ReportsTask 1: Identify the data that needs to be displayedin the Crystal Report and the format in which thedata is to be displayed. (Contd.) Cost Advance Percentage of the sale price paid as advance ©NIIT Creating Reports/Lesson 8/Slide 14 of 26
  15. 15. Creating ReportsTask 2: Identify the method to create a CrystalReport.Result:Since a calculated field of percentage needs to be displayed in the report, you will create the Crystal Reportmanually.Task 3: Identify the method to host the CrystalReport in a Windows application.Result:You will use the Windows Forms Viewer to host the Crystal Report in the Windows application. ©NIIT Creating Reports/Lesson 8/Slide 15 of 26
  16. 16. Creating ReportsTask 4: Retrieve the filtered data from the database.Task 5: Create a Crystal Report for the Windowsapplication.Task 6: Host the Crystal Report in the Windowsapplication.Task 7: Write the code to connect to the database.Task 8: View the Crystal Report from the WindowsForms Viewer. ©NIIT Creating Reports/Lesson 8/Slide 16 of 26
  17. 17. Creating ReportsProblem Statement 8.P.1An HR Manager of Diaz Telecommunications needs to view areport containing the query handling details for each employeeafter 9th July 2001 (the date of creation of the HR policy). Thedata should be displayed in the form of compact rows andcolumns with an average customer feedback for eachemployee. ©NIIT Creating Reports/Lesson 8/Slide 17 of 26
  18. 18. Creating ReportsProblem Statement 8.D.3The Sales Manager of Diaz Telecommunications needs toview a summarized product-wise order details report. Theproduct name for each product also needs to be displayed inthe report. ©NIIT Creating Reports/Lesson 8/Slide 18 of 26
  19. 19. Creating ReportsTask ListIdentify the data that needs to be displayed in the Crystal Report.Identify the method to create a Crystal Report.Identify the method to host Crystal Report in a Windowsapplication.Create a Crystal Report for the Windows application.Host the Crystal Report in the Windows application.View the Crystal Report from the Windows Forms Viewer. ©NIIT Creating Reports/Lesson 8/Slide 19 of 26
  20. 20. Creating ReportsTask 1: Identify the data that needs to be displayedin the Crystal Report.Result:As per the given problem statement, the data to bedisplayed in the Crystal Report is as follows: Prod ID Product Name Inv Date CustID Cost Advance ©NIIT Creating Reports/Lesson 8/Slide 20 of 26
  21. 21. Creating ReportsTask 2: Identify the method to create a CrystalReport.Result:You will create the Crystal Report by using the StandardReport Expert since it involves minimum steps.Task 3: Identify the method to host the CrystalReport in a Windows application.Result: You will use the Windows Forms Viewer to deliver theCrystal Report in the Windows application. ©NIIT Creating Reports/Lesson 8/Slide 21 of 26
  22. 22. Creating ReportsTask 4: Create a Crystal Report for the Windowsapplication.Task 5: Host the Crystal Report in the Windowsapplication.Task 6: View the Crystal Report from the WindowsForms Viewer. ©NIIT Creating Reports/Lesson 8/Slide 22 of 26
  23. 23. Creating ReportsSummaryIn this lesson, you learned that:Crystal Report is the standard reporting tool for VisualStudio .NET for displaying data of presentation quality.Crystal Reports use database drivers to connect with the data source for accessing data.Crystal Reports in Visual Basic .NET supports two methods to access data from a data source: The Pull model The Push model ©NIIT Creating Reports/Lesson 8/Slide 23 of 26
  24. 24. Creating ReportsSummary (Contd.)The presentation quality of a Crystal Report can beenhanced by adding the following components to theCrystal Report: Chart Cross-tab objectA Crystal Report can be hosted in a Windows Form byusing the Windows Forms Viewer.Apart from allowing an easy viewing of the Crystal Report in a Windows application, the Windows Forms Vieweralso dynamically updates the Crystal Report that is hosted. ©NIIT Creating Reports/Lesson 8/Slide 24 of 26
  25. 25. Creating ReportsSummary (Contd.) The Windows Forms Viewer can be inserted into a Windows application by dragging the CystalReportViewer control from the Toolbox into the form. The Windows Forms Viewer contains the following components: Toolbar Group Tree Main Report Window An interaction can be created between the Windows Forms Viewer and other controls on the Windows Form by handling the events of the Windows Form controls and the Windows Forms Viewer. ©NIIT Creating Reports/Lesson 8/Slide 25 of 26
  26. 26. Creating ReportsSummary (Contd.)To display a Crystal Report, it has to be bound to aCrystalReportViewer control.A Crystal Report can be bound to a CrystalReportViewer control by setting the ReportSource property of theCrystalReportViewer control to the path of the CrystalReport file. ©NIIT Creating Reports/Lesson 8/Slide 26 of 26

×