Siêu thị PDFTải ngay đi em, trời tối mất

Thư viện tri thức trực tuyến

Kho tài liệu với 50,000+ tài liệu học thuật

© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Wrox Professional Crystal Reports for Visual Studio NET Second Edition phần 10 docx
PREMIUM
Số trang
44
Kích thước
1.1 MB
Định dạng
PDF
Lượt xem
1073

Wrox Professional Crystal Reports for Visual Studio NET Second Edition phần 10 docx

Nội dung xem thử

Mô tả chi tiết

10 557300 Ch10.qxd 3/24/04 9:57 AM Page 320

Chapter 10

Figure 10-6

Select the merge module you want to add, and click Open to add the module to the list. If you would

like to see what files are included with a module, view the Properties and check out the Files property,

as shown in Figure 10-7.

Figure 10-7

You can also see any dependencies that a module has by viewing the ModuleDependencies property,

which will give the dialog shown in Figure 10-8.

320

10 557300 Ch10.qxd 3/24/04 9:57 AM Page 321

Distributing Your Application

Figure 10-8

Working with Licensing

One of the requirements for using Crystal Reports .NET and distributing the free run time and reports

with your application is that you register the software and your personal details with Crystal Decisions.

What better way to enforce registration than with a nag screen that appears whenever you open the

report designer? (Charming, I know!)

In order to successfully distribute your application and get rid of the nag screen, you are going to need

to register with Crystal Decisions and obtain a registration number. When you first started the Crystal

Reports designer, chances are you were prompted to register at that point.

If you just clicked Cancel (like most people), you can still register by opening the Report Designer and

selecting Register from the right-click menu.

If you have registered, we need to take the registration number you were given and enter it into the

Regwiz.msn merge module.

To copy your registration number (or to find out if you are registered), select Help → About Microsoft

Development Environment to display a list of all of the Visual Studio .NET products you have installed.

Note the registration number (or to do it the easy way, highlight Crystal Reports .NET and click the

Copy Info button). From that point, click OK to return to your project, and locate the License Key prop￾erty under Regwiz.msm merge module. You will need to enter or paste this license key before you build

your setup project.

This is one of the most common errors when deploying applications that use Crystal Reports so don’t

forget to do it every time you create a setup project.

321

10 557300 Ch10.qxd 3/24/04 9:57 AM Page 322

Chapter 10

Building Your Setup Project

The last step of creating our setup project is to actually build the setup project. To build your setup,

select Build → Build ch10_Setup and keep an eye on the Output window.

The default Project Configuration is Debug, and Projectname is the name of the

deployment project. In our instance, if you had unzipped the sample files for this

chapter into a CrystalReports directory on your machine, the setup directory would

be found at C:\Crystal.NET2003\Chapter10\code\setup_wizard\Debug.

Along with the MSI file that has been generated, there are also some additional files that should be in the

same directory:

❑ setup.exe — a wrapper for the .MSI file that has been created and a utility that verifies the

correct Windows Installer version and installs the correct version

❑ setup.ini — an .ini file containing the location of the Windows Installer files

❑ Instmsia.exe — the Windows Installer files for Windows 95, 98, and ME

❑ Instmsiw.exe — the Windows Installer files for Windows NT

If the setup finds that Windows Installer is not present or the correct version, it will launch the correct

executable (instmsia.exe or instmsiw.exe) to install or update the Windows Installer service before

installing your own application.

Testing and Deploying Your Setup Project

To test your generated deployment package, copy the entire directory to another computer or CD, and

run the setup.exe file.

To test your application setup, you should be able to see where your files were installed and verify that

they are present. Also, the application should appear under the Add/Remove Programs option in the

Windows Control Panel.

In addition, if you have added a shortcut to your application, you should be able to select the shortcut

you have created, and it should launch the application. Make sure that you test the reports themselves.

View a number of different reports and try out the features such as drill-down and exporting.

Once you are satisfied the application is installed and that it and the reports run correctly, you can

distribute the setup files within the subdirectory to users as required.

Deploying Web Applications

This section details how to create an installer to distribute a simple reporting application. We won’t

cover the steps in much detail here because most of the information is the same as for Windows applica￾tions; so if you have jumped straight to this part of the chapter, then please refer to Deploying Windows

Applications to fill in the details.

322

10 557300 Ch10.qxd 3/24/04 9:57 AM Page 323

Distributing Your Application

Preparing Your Web Server

Before you can install a new Web application, the Web server you are installing needs to have the .NET

Framework installed first. Just as with Windows applications, there is no automated way to install this

from your setup project so you will probably have to create a batch file or install it manually.

database or other data source, you will need to install MDAC 2.6 or greater in order

www.microsoft.com/data/.

In addition to the .NET 1.1 Framework, if your Web application accesses data from a

for your application to work. You can download the latest MDAC components from

the Microsoft Web site at

Finally, when exporting directly from Crystal Reports and the Web Forms Viewer, you may need to con￾figure some additional MIME types on your Web server to associate a file extension (such as a PDF file)

with its helper application (in this case, Acrobat32.exe).

For more information on configuring MIME types for your version of IIS, visit the MSDN library at

http://msdn.microsoft.com, and search for “MIME.”

Creating the Setup Project

Firstly, just as in the section on Windows deployment, we need a simple Web reporting application to

deploy, and one has been included for you in the downloadable files for this chapter in a project named

ch10_web_app. This application consists of a single Web Form that has the Web version of the Crystal

Report Viewer embedded and allows you to preview the same Employee Listing report that we looked

at when working with the sample Windows application earlier.

To see this application working, you will need to create the virtual directory and place the files in this

directory.

Again, we need a Setup Project for this Web application. As before, we have already added this to our

sample project called ch10_web_setup, as shown in Figure 10-9.

Figure 10-9 323

Tải ngay đi em, còn do dự, trời tối mất!