Professional.Crystal.Reports.for.Visual.Studio..NET [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Professional.Crystal.Reports.for.Visual.Studio..NET [Electronic resources] - نسخه متنی

David McAmis

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید



























Exploring the Development Environment



When creating ASP.NET web applications, you don't need a specialized editor to develop the required components - you could just crack open Notepad and create all of the files required yourself. Thankfully, Visual Studio .NET provides a feature-rich development environment that makes things a bit easier when creating ASP.NET applications and there are a number of Crystal-specific components for use in web applications.

To start with, in the toolbox under the Web Forms section, you will find the CrystalReportViewer, which we will be working with a little later. When you drop or draw this viewer on a Web form, as shown below, you can set a number of properties and use the viewer to display a "What-you-see-is-what-you-get" (or WYSIWYG) preview of your report.


In addition to the CrystalReportViewer, there is also a ReportDocument component available in the Components section of the toolbox. We use this component to add strongly-typed and untyped reports to a form. (If you just opened this book and flipped to this chapter, you may be wondering what a typed report is, don't worry - we'll get to that a little later in the chapter.)

Finally, like most Windows applications, the majority of our report integration will take place in the code view of the form.

Using the object models provided by Crystal Reports.NET, you have almost complete control over the report's appearance and behavior.



Before You Get Started


Before we can actually get into creating web-based applications, you will need to check and see if you have all of the required components installed to run these applications. ASP.NET web applications run on a web server that can either be located on your local machine or on another server that you have access to that has IIS installed.

When you installed Visual Studio .NET, you may have received an error message if you did not have a web server installed on your machine at that time. If you are working on a computer that does not have IIS installed and the required .NET components loaded, you will need to have access to a server that does in order to create the forms and applications demonstrated in this chapter.

For more information on installing the .NET Framework and preparing a web server for application development, check out the Visual Studio .NET Combined Help Collection and search for "Configuring Applications".



Starting a New Web Application with VB.NET


The first thing we need to do to get started is to create a new web application using Visual Basic .NET. Included with the download files for this chapter are a number of projects that are related to the different sections in this chapter. To walk through the examples that follow, you can either create a new solution or open the one that is provided (the same applies to the other projects - you can either follow along or create your own).

To create a new web application, from within Visual Studio, select File | New | Project and from Visual Basic Applications, select ASP.NET Web Application and specify a name (web_viewer_basic) and location for your project files.



Since you are creating a web application, the location will be a web server that you have access to and the name of your project will actually be used to create a virtual directory on this server. (The good news is that Visual Studio .NET will automatically do this for you if you are building the application from scratch - there is no need to create the folder and virtual directory prior to creating a new project.)

If, however, you choose to use the supplied download code, then you should create a virtual directory (in our case, this is C:\CrystalReports\Chapter04\web_viewer_basic) by selecting Control Panel | Administrative Tools | Internet Information Services, and then right-clicking on Default Web Site. This will open another menu:


Select New | Virtual Directory and the virtual directory wizard will commence. Assign the new directory the alias web_viewer_basic and set the path to C: \CrystalReports\Chapter04\web_viewer_basic. Make sure both read and write are enabled and finish the wizard.

Either way you choose to do it, the development environment will open with a default form that we will be using in the section. Throughout the chapter, we will be using only one or two Web Forms to demonstrate different integration features, but the same concepts can be applied to your own web applications.

Before you go any further, we need to get some basic architecture decisions for your web application out of the way, starting with a brief discussion of the object models available within Crystal Reports.NET.



/ 115