Crystal Reports
For Visual Studio 2005
Web or Windows Deployment Tutorials
Web or Windows Deployment Tutorials
Copyright © 2004 Business Objects
Page 2
© 2004 Business Objects. All rights reserved.
Business Objects, the Business Objects logo, Crystal Reports, and Crystal Enterprise are
trademarks or registered trademarks of Business Objects SA or its affiliated companies
in the United States and other countries. All other names mentioned herein may be
trademarks of their respective owners.
Version 1.0
Web or Windows Deployment Tutorials
Copyright © 2004 Business Objects
Page 3
Web or Windows Deployment Tutorials
The procedures in the following sections create deployment projects for Web Sites or
Windows applications for Visual Studio 2005.
• Requirements
• Deploying Web Sites
• Deploying Windows Applications
Note For more information about deployment in Crystal Reports for Visual Studio
.NET 2002 or 2003, and Crystal Reports 10, please refer to the online help in Visual
Studio 2005.
CrystalReportViewer binding scenarios for Crystal Services uses Crystal Reports for
Visual Studio or Crystal Reports 9. In this case, you need to use slightly different
deployment procedures than the procedures in this tutorial. For more information
about deployment in Crystal Reports for Visual Studio and Crystal Reports 9, see
http://support.businessobjects.com/search/.
For more information about the report binding scenarios, please refer to the online
help in Visual Studio 2005.
Requirements
To successfully deploy a Web Site or Windows application, you must complete
Appendix: What Needs to be Installed? and Appendix: Project Setup.
Check that the following requirements are met:
• Visual Studio 2005 is installed. See Appendix: What Needs to be Installed?.
• Web Sites or Windows applications have been created with one or more report
binding scenarios. Please refer to the online help in Visual Studio 2005.
In addition, you must either use merge modules or the Server Installer (.msi file) to
complete the deployment. One of the following procedures must be completed:
• Download the Crystal Reports merge modules from
http://www.businessobjects.com/products/dev_zone/net/VisualStudio2005Beta,
and then save the .msm files in C:\Program Files\Common Files\Merge Modules
folder of your local directory. You need to overwrite the files that already exist in
this folder. For more information, see Appendix: Crystal Reports Merge Modules for
Visual Studio 2005.
• Or, download the Server Installer (.msi file) from
http://www.businessobjects.com/products/dev_zone/net/VisualStudio2005Beta,
and then install the files on the target machine. The Server Installer installs the
Crystal Reports runtime and the merge modules that are required by a deployment
project. The Server Installer is available for x86, AMD64 and IA64 machines.
Deploying Web Sites
To deploy your Web Sites, you must create a Web Setup Project as instructed in the
sections that follow, and then add the necessary components to your project.
Web or Windows Deployment Tutorials
Copyright © 2004 Business Objects
Page 4
Creating a Web Setup Project
In this section, you create a Web Setup Project from the deployment projects that are
available in Visual Studio. You must have a completed Web application that uses at
least one of the report binding scenarios.
To create a deployment project for Web applications
1. In Visual Studio, open your Web Site.
2. On the File menu, point to Add, and then click New Project.
3. In the Add New Project dialog box, select Setup and Deployment Projects in
the Project Types pane, and select Web Setup Project in the Templates pane.
Click OK.
4. When the File System tab appears, expand Web Application Folder on the left
pane.
5. In the Properties window, set the DefaultDocument property to the start page (a
.aspx file) for the Web Site.
The VirtualDirectory property has been set to the default project name,
"WebSetup1." The default project name must remain "WebSetup1."
Adding Components to the Web Setup Project
You must add the content files from your Web Site and merge modules to the Web
Setup Project. Merge modules must be added to the setup project, if you do not plan to
install the Server Installer on the target computer.
To add components to the Web Setup Project
1. In Solution Explorer, right-click WebSetup1, point to Add, and then click
Project Output....
2. In the Add Project Output Group dialog box, select Content Files.
3. In Solution Explorer, right-click WebSetup1, point to Add, and then click Merge
Module....
4. In the Add Modules dialog box, select the merge modules that are required for
your Web Site.
For a description of which merge modules to use for different machines, see
Appendix: Crystal Reports Merge Modules for Visual Studio 2005.
Building and Deploying the Web Setup Project
Building the Web Setup Project creates an installer that you can deploy to other
computers.
Note When you deploy to other computers, always ensure that the computer
already has the .NET Framework installed. For more information about the .NET
Framework, please refer to the online help in Visual Studio 2005.
To build and deploy the Web Setup Project
1. From the Build menu, click Build WebSetup1.
The build process creates installer files: setup.exe and WebSetup1.msi (name of
your deployment project).
Web or Windows Deployment Tutorials
Copyright © 2004 Business Objects
Page 5
2. Navigate to the directory where your deployment project has been saved.
3. Double-click the WebSetup1 folder.
4. Open the Debug folder to find the built files from the Web Setup Project.
5. Copy all the files to the target computer.
6. Distribute the Crystal reports that are used in the Web application. For more
information about which binding scenarios need to distribute report files, see
Appendix: Report Files.
7. On the target computer, double-click Setup.exe or WebSetup1.msi to install the
Web application.
8. To view the Web application in deployment, start Microsoft Internet Explorer, and
type http://localhost/WebSetup1.
Deploying Windows Applications
To deploy your Windows applications, you must create a Setup Project and add the
necessary components to your project.
Creating a Setup Project for Windows Applications
In this section, you need to create a Setup Project from the deployment projects
available in Visual Studio. You need to have a completed Windows application that uses
at least one of the report binding scenarios. Please refer to the online help in Visual
Studio 2005.
To create a deployment project for Windows applications
1. In Visual Studio, open your Windows application.
2. On the File menu, point to Add Project and then click New Project.
3. In the Add New Project dialog box, select Setup and Deployment Projects in
the Project Types pane and select Setup Project in the Templates pane. Click
OK.
Adding Components to the Setup Project
You must add output files from the Windows application, and merge modules to the
Setup Project.
To add components to the Setup Project
1. In Solution Explorer, right-click Setup1, point to Add, and then click Project
Output....
2. In the Add Project Output Group dialog box, select Primary output.
When Primary output is added to your project, the Crystal Reports assembly files
are added automatically.
3. In Solution Explorer, right-click Setup1, point to Add, and then click Merge
Module....
4. In the Add Modules dialog box, select the merge modules that are required for
your Windows application.
For a description of which merge modules to use for different machines, see
Appendix: Crystal Reports Merge Modules for Visual Studio 2005.
Web or Windows Deployment Tutorials
Copyright © 2004 Business Objects
Page 6
Building and Deploying the Setup Project
Building the Setup Project creates an installer that you can deploy to other computers.
Note When deploying to other computers, always ensure that the computer
already has the .NET Framework installed.
To build and deploy the Setup Project
1. From the Build menu, choose Build Setup1.
The build process creates installer files: setup.exe and Setup1.msi (name of your
deployment project).
2. Navigate to the directory where your deployment project has been saved.
3. Double-click the Setup1 folder.
4. Open the Debug folder to find the built files from the Setup Project.
5. Copy all the files to the target computer.
6. Distribute the Crystal reports that are used in the Windows application. For more
information about which binding scenarios need to distribute report files, see
Appendix: Report Files.
7. On the target computer, double-click Setup.exe or Setup1.msi to install the
Windows application.
8. To view the Windows application in deployment, navigate to the installed location,
and then double-click the Windows application .exe file.
Web or Windows Deployment Tutorials
Copyright © 2004 Business Objects
Page 7
Appendix: Crystal Reports Merge Modules for Visual
Studio 2005
Crystal Reports for Visual Studio 2005 uses merge modules to ensure the correct report
components and assemblies are installed with your deployment project.
Each merge module is designed for different deployment scenarios.
Note Adding more merge modules to the deployment project than what is
specified in the scenarios may cause deployment problems.
For the specified machine and project type, you must add the correct merge modules to
the project.
Machine type Project type Merge modules required
x86 Windows applications • Crystal_Database_Access.msm
• Crystal_Database_Access_enu.msm
• Crystal_Managed.msm
x86 Web Sites • Crystal_Database_Access.msm
• Crystal_Database_Access_enu.msm
• Crystal_Managed.msm
• Crystal_Webformviewer.msm
AMD64 Windows applications • Crystal_Database_Access_A64.msm
• Crystal_Database_Access_enu_A64.msm
• Crystal_Managed_A64.msm
• _VC_80_WinSxS_ATL_AMD_RTL_X86_---
.msm
• _VC_80_WinSxS_MFC_AMD_RTL_X86_--
-.msm
AMD64 Web Sites • Crystal_Database_Access_A64.msm
• Crystal_Database_Access_enu_A64.msm
• Crystal_Managed_A64.msm
• Crystal_Webformviewer.msm
• _VC_80_WinSxS_ATL_AMD_RTL_X86_---
.msm
• _VC_80_WinSxS_MFC_AMD_RTL_X86_--
-.msm
IA64 Windows applications • Crystal_Database_Access_I64.msm
• Crystal_Database_Access_I64_enu.msm
• Crystal_Managed_I64.msm
• _VC_80_WinSxS_ATL_IA_RTL_X86_---
.msm
• _VC_80_WinSxS_MFC_IA_RTL_X86_---
Web or Windows Deployment Tutorials
Copyright © 2004 Business Objects
Page 8
.msm
IA64 Web Sites • Crystal_Database_Access_I64.msm
• Crystal_Database_Access_I64_enu.msm
• Crystal_Managed_I64.msm
• Crystal_Webformviewer.msm
• _VC_80_WinSxS_ATL_IA_RTL_X86_---
.msm
• _VC_80_WinSxS_MFC_IA_RTL_X86_---
.msm
The merge modules can be downloaded from
http://www.businessobjects.com/products/dev_zone/net/VisualStudio2005Beta.
Note For more information about merge modules in Crystal Reports for Visual
Studio .NET 2002 or 2003, and Crystal Reports 10, please refer to the online help in
Visual Studio 2005.
Web or Windows Deployment Tutorials
Copyright © 2004 Business Objects
Page 9
Appendix: Report Files
Crystal report binding scenarios use either embedded or non-embedded reports.
In Visual Studio applications, embedded reports are compiled into the deployment
project. Deployment projects can then be distributed and deployed without having to
distribute report files separately.
For applications that use non-embedded reports, the report files are not compiled into
the deployment projects. The report files must be distributed with the projects.
For more information about embedded and non-embedded reports, please refer to the
online help in Visual Studio 2005.
The following table describes what you must do to successfully distribute and view
deployment projects that use specific reporting binding scenarios.
Report binding scenarios Requirements
• Binding to a File Directory Path in
Code
• Binding to a File Directory Path
Through the Properties Window
• Binding to a Non-embedded Report
Class Loaded into ReportDocument
• Binding to a Non-embedded Report
Class Loaded into a Cache
Management Utility Class
• Distribute the report files with the
deployment project.
• On the target computer, save the
report files in the path directory that is
used in the Web or Windows
application.
• Binding to a Report Web Service URL • No need to distribute report files;
report files are compiled into the
Report Web Service project.
• Binding to an Embedded Report Class
• Binding to an Embedded Report Class
Upcast to ReportDocument
• Binding to a Cached Embedded Report
Class
• Binding to Crystal Enterprise (Crystal
Reports 10)
• No need to distribute report files;
report files are compiled into the
project.
• Binding to Report Application Server
(Crystal Reports 10)
• Binding to Unmanaged RAS Using
ReportDocument.Load() Method (RAS
10)
• Binding to Unmanaged RAS Using
ReportDocument.FileName Property
(RAS 10)
• Binding to Unmanaged RAS Using
ReportClientDocument.Open() Method
• No need to distribute report files;
report files are accessed through the
unmanaged RAS server.
• The unmanaged RAS server that is
used in the binding scenarios needs to
be running on the network.
• Report binding scenario in Binding to
Unmanaged RAS Using
ReportClientDocument.Open() Method
(RAS 9 and up) needs Report
Web or Windows Deployment Tutorials
Copyright © 2004 Business Objects
Page 10
(RAS 9 and up) Application Server to be installed on
the target computer.
• Binding to ReportSource (Crystal
Enterprise 10)
• Binding to Managed RAS Using
ReportDocument.Load() Method (RAS
within CE 10)
• Binding to Managed RAS Using
ReportDocument.FileName Property
(RAS within CE 10)
• Binding to Managed RAS Using
ReportAppFactory.OpenDocument()
Method (RAS within CE 9 and
up)Binding to InfoObject Cast as
Report
• No need to distribute report files;
report files are accessed through the
managed RAS server.
• The managed RAS server that is used
in the report binding scenarios needs
to be running on the network.
• Report binding scenario in Binding to
ReportSource (Crystal Enterprise 10)
needs Crystal Enterprise .NET SDK
and Crystal Enterprise Publishing
Wizard to be installed on the target
computer.
Note For more information about each binding scenario, please refer to the online
help in Visual Studio 2005.
Web and Windows Deployment
Copyright © 2004 Business Objects
Page 11
Appendix: Project Setup
This section is a key learning point for both advanced and intermediate developers. It
demonstrates the recommended best practices to follow to create and configure a new
Windows project or Web project/site with Crystal Reports for Visual Studio .NET 2002 or
2003, and Crystal Reports for Visual Studio 2005.
Visual Studio Versions
Project Setup requires different procedures for Visual Studio .NET 2002 and 2003, as
compared to the Project Setup procedures for Visual Studio 2005.
Click the appropriate link to jump to the section that corresponds to your version of
Visual Studio:
• Visual Studio .NET 2002 or 2003
• Visual Studio 2005
Project Setup in Visual Studio .NET 2002 or 2003
In Crystal Reports for Visual Studio .NET 2002 or 2003, both Web and Windows
applications are built from a common structure:
• A Web project.
• A Windows project.
Therefore a common set of instructions can be given for setting up your project, with
only minor variations for the Web or Windows versions of the project.
The procedures in this section must be completed in succession:
• Creating a New Web or Windows Project
• Applying Standard Project Settings
• Preparing the Web or Windows Form
• Adding a CrystalReportViewer Control
Creating a New Web or Windows Project in Visual
Studio .NET 2002 or 2003
Before you create a Web or Windows project, verify that Crystal Reports for Visual
Studio .NET 2002 or 2003 has been installed on your system. See Appendix: What
Needs to be Installed?.
Note Use a Pascal naming convention: set the first letter of the project name to
uppercase (because the project name also becomes the namespace name for the
assembly generated from the project).
Creating a New Web Project in Visual Studio .NET 2002 or 2003
To set up a Web project in Crystal Reports for Visual Studio .NET 2002 or 2003
1. Launch Visual Studio.
2. From the File menu, select New, and then click Project.
3. In the New Project dialog box, click either Visual C# Projects or Visual Basic
Projects from the Project types list.
Web and Windows Deployment
Copyright © 2004 Business Objects
Page 12
4. From the Templates list, click ASP.NET Web Application.
5. In the Location field, replace the default project name with the name of your
project.
The sample below assumes that your server name is http://localhost.
[Visual Basic]
http://localhost/MyProjectNameVBNET
[C#]
http://localhost/MyProjectNameCSharp
6. Click OK.
Creating a New Windows Project in Visual Studio .NET 2002 or
2003
To set up a Windows project in Crystal Reports for Visual Studio .NET 2002 or
2003
1. Launch Visual Studio.
2. From the File menu, select New, and then click Project.
3. In the New Project dialog box, click either Visual C# Projects or Visual Basic
Projects from the Project types list.
4. From the Templates list, click Windows Application.
5. In the Name field, replace the default project name with the name of your project.
6. Click OK.
Applying Standard Project Settings in Visual Studio
.NET 2002 or 2003
A few minor modifications must be made to the project settings to configure the project
to work with the tutorials in this documentation.
Note Flow layout uses plain html without pixel placement instructions. This
generates thinner, more readable html code. The use of flow layout has been
adopted in all tutorials and sample code that are supplied with the help
documentation.
To modify project settings for a Visual Basic project in Crystal Reports for
Visual Studio .NET 2002 or 2003
1. In your Visual Basic project, right-click the project name (the name in bold that is
just below the solution name in Solution Explorer), and then select Properties.
2. In the Property Pages dialog box, expand the Common Properties folder, and
click Build.
3. On the OptionStrict list, click On.
Note As a best practice, it is recommended that you enable OptionStrict at the
start of any Visual Basic project. When you write code, it forces the use of best
practices with strongly typed variable declarations and valid casting, both of
which are checked at compile time. Compile-time checks that are strictly
enforced can reduce run-time exceptions.
Web and Windows Deployment
Copyright © 2004 Business Objects
Page 13
4. In the same folder, select Designer Defaults. On the Page Layout list, set the
value as follows:
• In a Windows project, set the value to Grid.
• In a Web project, set the value to Flow.
To modify project settings for a C# in Crystal Reports for Visual Studio .NET
2002 or 2003
1. In your C# project, right-click the project name (the name in bold that is just below
the solution name in Solution Explorer) and click Properties.
2. In the Property Pages dialog box, expand the Common Properties folder, and
click Designer Defaults. On the Page Layout list, set the value as follows:
• In a Windows project, set the value to Grid.
• In a Web project, set the value to Flow.
Pr
本文档为【Web_Win_Deployment_Crystal2005】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。