CATEGORII DOCUMENTE |
Asp | Autocad | C | Dot net | Excel | Fox pro | Html | Java |
Linux | Mathcad | Photoshop | Php | Sql | Visual studio | Windows | Xml |
DOCUMENTE SIMILARE |
||||
|
||||
Overview of Part 3
Visual Studio .NET is a highly extensible development
environment. Over 100 ISVs will be shipping new .NET versions of their tools
and add-ons for Visual Studio .NET. You'll find a special version of Crystal
Reports integrated directly into the Visual Studio .NET IDE.
Crystal Reports fills an important role in the application development process
by providing developers with a productive, integrated, and RAD experience for
creating highly interactive relational data reports. These reports can be
generated for the entire array of .NET application types, including XML Web
services and Web-based solutions, as well as Windows-based applications running
on desktop PCs and mobile devices.
Downhill Bikes management would like to enhance their application with a new reporting
capability. The new report will enable them to drill into customer orders and
look for trends in customer spending.
Proceeding with our tour, we will use Crystal Reports to extend our existing
smart client with built-in reporting.
Part 3: Extend the Windows Form
Step 1 of 6: Add a new Visual Basic. NET Windows Form
We will add a second Windows Form to our project to contain the Crystal Report we build in the next step.
a. In the Solution Explorer, right-click WindowsApplication1, click Add, then click Add New Item. .
b. In the Templates pane, click the Windows Form icon and click Open (the default Name of Form2.vb is fine).
Part 3: Extend the Windows Form
Step 2 of 6: Add a Crystal Report Viewer
The Crystal Report Viewer is integrated into Visual Studio .NET like the other rich controls in the toolbox. We will drag this report viewer to our form and use the new Windows Forms dock feature to automatically resize the report when we resize the form.
a. From the View menu, click Toolbox. CTRL+ALT+X
b. Click the Windows Forms tab in the toolbox.
c. Drag the Crystal Report Viewer (it's at the bottom of the list) to the Windows Form designer surface. Make sure that the Crystal Report Viewer is selected in the designer.
d. From the View menu, click Properties Window. F4
e. From the Properties tool window, click Dock and press the letter F for Fill.
Part 3: Extend the Windows Form
Step 3 of 6: Add a Report Document
Using existing or new reports is easy with Visual Studio .NET. In this step we just assign the report to the report document.
a. From the File menu, click Add Existing Item. . SHIFT+ALT+A
b. In the Files of type list, change the selection to All Files (*.*).
b. Navigate to Program FilesGuidedTourProjects, click the CrystalReport1.rpt report template, and click Open.
c. From the View menu, click Toolbox. CTRL+ALT+X
d. Click the Components tab in the toolbox.
e. Double-click on the ReportDocument icon and click OK in the Choose a ReportDocument dialog box.
Part 3: Extend the Windows Form
Step 4 of 6: Hook up the Report Viewer
In this step we will pass the data from the Web service to the Crystal Report. Crystal Reports was designed to integrate easily into Visual Studio .NET projects, so reports can reuse existing DataSets, relieving the developer from having to recreate their data access logic.
a. From the View menu, click Code. F7
b. Position the cursor on the empty line above End Class.
c. Double-click on the 3.4 Reporting code snippet in the Guided Tour toolbox.
Part 3: Extend the Windows Form
Step 5 of 6: Show the new Windows Form
In this step we will add a button to call the report form we just created.
a. From the View menu, click Solution Explorer. CTRL+ALT+L
b. Double-click Form1.vb in the Solution Explorer.
c. From the View menu, click Toolbox. CTRL+SHIFT+X
d. Drag a Button from the Windows Forms tab to the right of Search.
e. Double-click Button2 to add the click event handler.
f. In the Toolbox, double-click the 3.5 Show Reports form code item. The code should look like this:
Part 3: Extend the Windows Form
Step 6 of 6: Try it
Let's run the application and examine the rich report.
a. From the Debug menu, click Start to run the application. F5
b. Click Button2 to open the report.
c. Maximize the Form2 window.
d. Double-click an entry in the Order Date column to get order details.
e. Close the Form2 and Form1 windows.
f. In Visual Studio .NET, from the Window menu, click Close All Documents. If asked to save changes, click Yes.
In this step of the Guided Tour, you successfully incorporated a Crystal Reports viewer into the Downhill Bikes smart client application. This exercise illustrates the power of the Visual Studio .NET extensibility model by showing how third-party tool and language vendors can seamlessly integrate their products directly into Visual Studio .NET.
In the next step of the Guided Tour, we'll delve into Web application development and the use of Application Center Test to analyze the load performance of our Web applications.
Politica de confidentialitate | Termeni si conditii de utilizare |
Vizualizari: 1205
Importanta:
Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved