Beruflich Dokumente
Kultur Dokumente
Version 1.0
Page 2
Web or Windows Deployment Tutorials
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.
Page 3
Web or Windows Deployment Tutorials
Page 4
Web or Windows Deployment Tutorials
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.
Page 5
Web or Windows Deployment Tutorials
Page 6
Web or Windows Deployment Tutorials
Page 7
Web or Windows Deployment Tutorials
.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
Page 8
Web or Windows Deployment Tutorials
Page 9
Web or Windows Deployment Tutorials
Note For more information about each binding scenario, please refer to the online
help in Visual Studio 2005.
Page 10
Web and Windows Deployment
Page 11
Web and Windows Deployment
http://localhost/MyProjectNameVBNET
[C#]
http://localhost/MyProjectNameCSharp
6. Click OK.
Page 12
Web and Windows Deployment
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.
Page 13
Web and Windows Deployment
End Sub
[end]
[C#]
ConfigureCrystalReports()
[end]
[C#]
ConfigureCrystalReports();
[end]
4. Click the - symbol on the Web Form Designer generated code region to collapse
the contents of this region.
5. In Solution Explorer, right-click Default.aspx, and then click Set As Start Page.
This page is now the first page to load when the website is accessed.
6. From the File menu, click Save All.
Page 14
Web and Windows Deployment
End Sub
[end]
[C#]
ConfigureCrystalReports()
[end]
Copyright © 2004 Business Objects
Page 15
Web and Windows Deployment
[C#]
ConfigureCrystalReports();
[end]
Note If you use Visual Basic, you can now collapse the Windows Form Designer
generated code region.
3. From the File menu, click Save All.
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
[end]
Copyright © 2004 Business Objects
Page 16
Web and Windows Deployment
[C#]
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
[end]
Note To access various classes for Crystal Reports without a namespace prefix,
you must declare those namespaces at the top of the class.
You have now completed the procedures to create a Web or Windows project in Visual
Studio .NET 2002 or 2003.
Page 17
Web and Windows Deployment
3. In the New Web Site dialog box, select a language folder for C# or Visual Basic
from the Project Types list.
4. From the Templates list, click ASP.NET Web Site.
5. In the Location field, replace the default project name,
C:\WebSites\WebApplication1, with the name of your project.
C:\WebSites\MyProjectName
6. Click OK.
Page 18
Web and Windows Deployment
End Sub
[end]
[C#]
End Sub
[end]
[C#]
}
[end]
ConfigureCrystalReports()
[end]
Copyright © 2004 Business Objects
Page 19
Web and Windows Deployment
[C#]
ConfigureCrystalReports();
[end]
5. From the File menu, click Save All.
Page 20
Web and Windows Deployment
In Visual Studio 2005, the .aspx page, and its corresponding code-beside class compile
together into a single class to share members. This is possible because a new feature of
Visual Studio 2005, called partial classes.
For example, when you add a CrystalReportViewer control to the Default.aspx page, at
compile time, the page becomes the Default_aspx partial class. The controls on the
.aspx page are converted to class-level variable declarations. Because the code-beside
class is also a partial Default_aspx class, the .aspx page can access the properties and
methods of the CrystalReportViewer variable as a member of its own class.
Also, controls on the .aspx page can access methods in the code-beside class. For
example, a Button control can reference a click event method that is available in the
code-beside class from its OnClick property.
To add Imports/Using statements to reference namespaces
1. In Solution Explorer, open the Web.config.
2. In the <assemblies> node, verify that the following Crystal Reports assemblies have
been added:
• CrystalDecisions.CrystalReports.Engine
• CrystalDecisions.Shared
Note The references are automatically added to the Web.config file when you
drag and drop the CrystalReportViewer control onto the page. If for some reason
the references have not been added, you must open the Add Reference dialog
box and manually add the two assemblies listed above.
3. Click OK.
4. Select the Default.aspx page.
5. From the View menu, click Code.
The code-beside class for the Web Form appears.
6. Above the class signature, add an "Imports" [Visual Basic] or "using" [C#]
declaration for the namespaces of the assemblies that are listed above.
[Visual Basic]
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
[end]
[C#]
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
[end]
Note The classes of these two assemblies are commonly used in all tutorials.
For any additional assemblies that you may occasionally require in specific
tutorials, you will be directed to add them during that tutorial.
You have now completed the procedures to create a Web Site in Visual Studio 2005.
Page 21
Web and Windows Deployment
Page 22
Web and Windows Deployment
End Sub
[end]
[C#]
Page 23
Web and Windows Deployment
ConfigureCrystalReports()
[end]
[C#]
ConfigureCrystalReports();
[end]
5. From the File menu, click Save All.
Page 24
Web and Windows Deployment
For example, when you add a CrystalReportViewer control to Form1, Visual Studio 2005
regards that addition as a class-level variable declaration in the Form1.designer.cs (or
.vb) partial class. Because the code-beside class is also a partial Form1 class, Form1
can access the properties and methods of the CrystalReportViewer control.
Also, controls in one Form1 partial class can access methods in the other. For example,
a Button control in the Form1 Designer class can reference a click event method that is
available in the Form1 code-beside class from its OnClick property.
To add Imports/Using Statements to reference namespaces
1. If the References folder is not visible in Solution Explorer, on the Solution
Explorer toolbar, click Show All Files to display all project files.
2. In Solution Explorer, expand the References folder.
3. Verify that the following Crystal Reports assemblies have been added:
• CrystalDecisions.CrystalReports.Engine
• CrystalDecisions.Shared
4. Select Form1, and then from the View menu, click Code.
The Code view of the Form1 class appears.
5. Above the class signature, add an "Imports" [Visual Basic] or "using" [C#]
declaration to the top of the class containing the following Crystal Reports
namespaces.
[Visual Basic]
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
[end]
[C#]
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
[end]
Note To access various classes for Crystal Reports without a namespace prefix,
you must declare those namespaces at the top of the class.
You have now completed the procedures to create a Windows project in Visual Studio
2005.
Page 25
Web and Windows Deployment
Page 26
Web and Windows Deployment
Page 27