• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Vb.net session 08
 

Vb.net session 08

on

  • 387 views

 

Statistics

Views

Total Views
387
Views on SlideShare
358
Embed Views
29

Actions

Likes
0
Downloads
0
Comments
0

3 Embeds 29

http://niitcourseslides.blogspot.in 24
http://niitcourseslides.blogspot.ie 3
http://niitcourseslides.blogspot.com 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Vb.net session 08 Vb.net session 08 Presentation Transcript

    • Creating Crystal ReportsPre-Assessment Questions 1. Consider the following statements: • Statement A: A dataset can maintain four versions of a DataRow object. • Statement B: The four versions are Original, Current, Proposed, and Default. Which of the following is correct with respect to the above statements? a. Both, Statement A and Statement B, are False. b. Both, Statement A and Statement B, are True. c. Statement A is True and Statement B is False. d. Statement A is False and Statement B is True.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 1 of 30
    • Creating Crystal ReportsPre-Assessment Questions (Contd.) 2. Consider the following statements: • Statement A: The AcceptChanges() method is called for a dataset to accept all the changes made to the dataset. • Statement B: When the AcceptChanges() method is called, it overwrites the current version of a record with the proposed version. Which of the following is correct with respect to the above statements? a. Both, Statement A and Statement B, are False. b. Both, Statement A and Statement B, are True. c. Statement A is True and Statement B is False. d. Statement A is False and Statement B is True.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 2 of 30
    • Creating Crystal ReportsPre-Assessment Questions (Contd.) 3. Consider the following statements: • Statement A: In Pessimistic concurrency control, a system of locks applied does not allow users to modify data in a way that affects other users. • Statement B: Pessimistic concurrency can be implemented in a disconnected architecture. Which of the following is correct with respect to the above statements? a. Both, Statement A and Statement B, are False. b. Both, Statement A and Statement B, are True. c. Statement A is True and Statement B is False. d. Statement A is False and Statement B is True.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 3 of 30
    • Creating Crystal ReportsPre-Assessment Questions (Contd.) 4. Consider the following statements: • Statement A: In Optimistic concurrency control, the lock is applied when the users read the data. • Statement B: Optimistic concurrency is used in environments where the data contention is high. Which of the following is correct with respect to the above statements? a. Both, Statement A and Statement B, are False. b. Both, Statement A and Statement B, are True. c. Statement A is True and Statement B is False. d. Statement A is False and Statement B is True.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 4 of 30
    • Creating Crystal ReportsPre-Assessment Questions (Contd.) 5. Consider the following statements: • Statement A: ADO.NET implements optimistic concurrency by using the two methods Version Number method and Saving all values method. • Statement B: By default, the data adapters that are created in an ADO.NET application implement optimistic concurrency. Which of the following is correct with respect to the above statements? a. Both, Statement A and Statement B, are False. b. Both, Statement A and Statement B, are True. c. Statement A is True and Statement B is False. d. Statement A is False and Statement B is True.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 5 of 30
    • Creating Crystal ReportsSolutions to Pre-Assessment Questions 1. b. Both, Statement A and Statement B, are True. 2. c. Statement A is True and Statement B is False. 3. c. Statement A is True and Statement B is False. 4. a. Both, Statement A and Statement B, are False. 5. b. Both, Statement A and Statement B, are True.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 6 of 30
    • Creating Crystal ReportsObjectives In this lesson, you will learn to: • Access data through crystal reports • Create a crystal report manually • Use the Standard Report Expert • Create a report from an existing report • Enhance the crystal report • Host a crystal report in the windows application • View the crystal report • Access filtered data through crystal reports • Access related data through crystal reports©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 7 of 30
    • Creating Crystal ReportsUnderstanding Crystal Reports • Crystal Reports is the standard reporting tool for Visual Studio .NET used to display data of presentation quality. • Creating a Crystal Report requires minimal coding since it is created in a Designer interface.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 8 of 30
    • Creating Crystal ReportsData Access Through Crystal Reports • Crystal Reports need database drivers to connect to the data source for accessing data. • Crystal Reports in Visual Basic .NET support two methods to access data from a data source: • The Pull Model • The Push Model©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 9 of 30
    • Creating Crystal ReportsThe Pull Model • When Pull model is used to access data from the data source, the database driver directly retrieves the data from the data source. • Pull model does not require the developer to write code for creating a connection and retrieving data from the data source. • The Crystal Report creates and manages the SQL commands for connecting to the data source and retrieving data from it. CRYSTAL DATA SOURCE REPORT DATA The Pull Model©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 10 of 30
    • Creating Crystal ReportsThe Push Model • In this model, the developer writes the code to connect to the data source and retrieve data from it. • The data from the data source is cached in a dataset. • the Push model allows filtered data access by Crystal Report. • The Push model is generally useful for connection sharing scenarios. CRYSTAL DATASET DATA REPORT Data Data SOURCE The push model©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 11 of 30
    • Creating Crystal ReportsCreating Crystal Reports • Crystal Report can be created by using three methods: • Manually • Using Standard Report Expert • From an existing report©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 12 of 30
    • Creating Crystal ReportsCreating a Crystal Report Manually • To create a Crystal Report manually, user can perform the following steps: • Right-click the project name in the Solution Explorer window and select Add Add New Item from the shortcut menu option. • The Add New Item - <Application name> dialog box is displayed. Select Crystal Report from the Templates pane. • Name the Crystal Report as required and click the Open button, the Crystal Report Gallery is displayed. • Crystal Report Gallery displays three radio buttons, which are discussed below: • Using the Report Expert • As a Blank Report • From an Existing Report ©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 13 of 30
    • Creating Crystal ReportsCreating a Crystal Report Manually(Contd.) • The Report Designer is displayed with the sections Report Header, Page Header, Details, Report Footer, and Page Footer. • User can connect to a database and select the fields from the database table to be displayed in the Crystal Report.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 14 of 30
    • Creating Crystal ReportsUsing Standard Report Expert • To create a Crystal Report by using Standard Report Expert, perform the following steps: • Select Crystal Report in the Add New Item - <Application name> dialog box and click the Open button. • Then, Select the Using the Report Expert option from Crystal Report Gallery and click the OK button. • Standard Report Expert appears and insert the tables. • After inserting the tables, click the Next button. The Fields tab is displayed and fields can be selected by selecting the field and clicking the (Add ->) button. • After the fields to be displayed in the Crystal Report are selected, the various tabs under Standard Report Expert are added.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 15 of 30
    • Creating Crystal ReportsCreating Report from an Existing Report • To create a report based on the design of an existing report, you can perform the following steps: • Select the Crystal Report in the Add New Item - <Application name> dialog box and click the Open button. • Then, select the From an Existing Report option from Crystal Report Gallery and click OK button. • The Open dialog box is displayed. Select the existing Crystal Report file and click the Open button. • The Report Designer is displayed with the design of the selected file.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 16 of 30
    • Creating Crystal ReportsEnhancing the Crystal Reports • The presentation quality of a Crystal Report can be enhanced by adding the following components to the Crystal Report: • Charts • Cross-tabs©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 17 of 30
    • Creating Crystal ReportsHosting the Crystal Report in the Windows Application • A Crystal Report can be hosted in a Windows Form by using the Windows Forms Viewer. • The Windows Forms Viewer is present as a control in the Toolbox and contains the following components: • Toolbar • Export Report • Toggle Group Tree • Zoom • Search Text • Group Tree • Main Report window©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 18 of 30
    • Creating Crystal ReportsAdding a Windows Forms Viewer to the Windows Form • Follow the given steps to add a Windows Forms Viewer to the Windows Form: • From the Windows Forms tab of the Toolbox, drag the CrystalReportViewer control into the form and name it as RevenueReportViewer.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 19 of 30
    • Creating Crystal ReportsBinding the CrystalReportViewer Control to the Created Crystal Report • To do binding, follow the given steps: • In Properties window under the Misc category, click the ReportSource property and specify the source from where the Crystal Report would be accessed. • In Open an Existing Crystal Report dialog box dialog box, Select the report and click the Open button.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 20 of 30
    • Creating Crystal ReportsViewing the Crystal Report • To view the Crystal Report data, select Debug from the menu bar. Then, select Start from the Debug menu.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 21 of 30
    • Creating Crystal Reports Demo Accessing Filtered Data through Crystal Reports©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 22 of 30
    • Creating Crystal ReportsProblem Statement • The Sales Manager of Diaz Telecommunications needs to view a summarized report containing the order details for the products with sale price greater than $3000 to identify the potential market for the products in the coming period. In addition, the Sales Manager also needs to view the percentage of the sale price paid as advance for each order.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 23 of 30
    • Creating Crystal ReportsSolution • To create the required application, perform following tasks: 1. Retrieve the filtered data from the database. 2. Create a crystal report manually and group the data. 3. Create the formula for calculating percentage. 4. Host the Crystal Report. 5. Write the code to connect to the database at run time. 6. View the Crystal report.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 24 of 30
    • Creating Crystal Reports Demo Accessing Related Data Through Crystal Reports©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 25 of 30
    • Creating Crystal ReportsProblem Statement • The Sales Manager of Diaz Telecommunications needs to view a summarized product-wise order details report. The product name for each product also needs to be displayed in the report.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 26 of 30
    • Creating Crystal ReportsSolution • To create the required application, perform following tasks: 1. Create a Crystal Report 2. Host the Crystal Report. 3. View the Crystal report.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 27 of 30
    • Creating Crystal ReportsSummary In this lesson, you learned that: • A Crystal Report is a standard reporting tool for Visual Studio .NET used to display 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 • The presentation quality of a Crystal Report can be enhanced by adding the following components to the Crystal Report: • Chart • Cross-tab©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 28 of 30
    • Creating Crystal ReportsSummary (Contd.) • A Crystal Report can be hosted in a Windows Form by using the Windows Forms Viewer. • Apart from allowing an easy viewing of the Crystal Report in a Windows application, the Windows Forms Viewer also dynamically updates the Crystal Report that is hosted. • The Windows Forms Viewer can be inserted into a Windows application by dragging the CrystalReportViewer 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 Data Centric Application Using ADO.NET Lesson 2B / Slide 29 of 30
    • Creating Crystal ReportsSummary (Contd.) • 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. • To display a Crystal Report, it has to be bound to a CrystalReportViewer control. • A Crystal Report can be bound to a CrystalReportViewer control by setting the ReportSource property of the CrystalReportViewer control to the path of the Crystal Report file.©NIIT Creating Data Centric Application Using ADO.NET Lesson 2B / Slide 30 of 30