Crystal Reports For Visual Studio 2005 - Fmcs.uofg.edu.sd

Transcription

Crystal ReportsFor Visual Studio 2005Web or Windows Deployment Tutorials

Web or Windows Deployment Tutorials 2004 Business Objects. All rights reserved.Business Objects, the Business Objects logo, Crystal Reports, and Crystal Enterprise aretrademarks or registered trademarks of Business Objects SA or its affiliated companiesin the United States and other countries. All other names mentioned herein may betrademarks of their respective owners.Version 1.0Copyright 2004 Business ObjectsPage 2

Web or Windows Deployment TutorialsWeb or Windows Deployment TutorialsThe procedures in the following sections create deployment projects for Web Sites orWindows applications for Visual Studio 2005. Requirements Deploying Web Sites Deploying Windows ApplicationsNote 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 VisualStudio 2005.CrystalReportViewer binding scenarios for Crystal Services uses Crystal Reports forVisual Studio or Crystal Reports 9. In this case, you need to use slightly differentdeployment procedures than the procedures in this tutorial. For more informationabout deployment in Crystal Reports for Visual Studio and Crystal Reports 9, seehttp://support.businessobjects.com/search/.For more information about the report binding scenarios, please refer to the onlinehelp in Visual Studio 2005.RequirementsTo successfully deploy a Web Site or Windows application, you must completeAppendix: 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 reportbinding 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) tocomplete the deployment. One of the following procedures must be completed: Download the Crystal Reports merge modules fromhttp://www.businessobjects.com/products/dev zone/net/VisualStudio2005Beta,and then save the .msm files in C:\Program Files\Common Files\Merge Modulesfolder of your local directory. You need to overwrite the files that already exist inthis folder. For more information, see Appendix: Crystal Reports Merge Modules forVisual Studio 2005. Or, download the Server Installer (.msi file) fromhttp://www.businessobjects.com/products/dev zone/net/VisualStudio2005Beta,and then install the files on the target machine. The Server Installer installs theCrystal Reports runtime and the merge modules that are required by a deploymentproject. The Server Installer is available for x86, AMD64 and IA64 machines.Deploying Web SitesTo deploy your Web Sites, you must create a Web Setup Project as instructed in thesections that follow, and then add the necessary components to your project.Copyright 2004 Business ObjectsPage 3

Web or Windows Deployment TutorialsCreating a Web Setup ProjectIn this section, you create a Web Setup Project from the deployment projects that areavailable in Visual Studio. You must have a completed Web application that uses atleast one of the report binding scenarios.To create a deployment project for Web applications1. 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 inthe 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 leftpane.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 ProjectYou must add the content files from your Web Site and merge modules to the WebSetup Project. Merge modules must be added to the setup project, if you do not plan toinstall the Server Installer on the target computer.To add components to the Web Setup Project1. In Solution Explorer, right-click WebSetup1, point to Add, and then clickProject 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 MergeModule.4. In the Add Modules dialog box, select the merge modules that are required foryour Web Site.For a description of which merge modules to use for different machines, seeAppendix: Crystal Reports Merge Modules for Visual Studio 2005.Building and Deploying the Web Setup ProjectBuilding the Web Setup Project creates an installer that you can deploy to othercomputers.Note When you deploy to other computers, always ensure that the computeralready has the .NET Framework installed. For more information about the .NETFramework, please refer to the online help in Visual Studio 2005.To build and deploy the Web Setup Project1. From the Build menu, click Build WebSetup1.The build process creates installer files: setup.exe and WebSetup1.msi (name ofyour deployment project).Copyright 2004 Business ObjectsPage 4

Web or Windows Deployment Tutorials2. 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 moreinformation about which binding scenarios need to distribute report files, seeAppendix: Report Files.7. On the target computer, double-click Setup.exe or WebSetup1.msi to install theWeb application.8. To view the Web application in deployment, start Microsoft Internet Explorer, andtype http://localhost/WebSetup1.Deploying Windows ApplicationsTo deploy your Windows applications, you must create a Setup Project and add thenecessary components to your project.Creating a Setup Project for Windows ApplicationsIn this section, you need to create a Setup Project from the deployment projectsavailable in Visual Studio. You need to have a completed Windows application that usesat least one of the report binding scenarios. Please refer to the online help in VisualStudio 2005.To create a deployment project for Windows applications1. 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 inthe Project Types pane and select Setup Project in the Templates pane. ClickOK.Adding Components to the Setup ProjectYou must add output files from the Windows application, and merge modules to theSetup Project.To add components to the Setup Project1. In Solution Explorer, right-click Setup1, point to Add, and then click ProjectOutput.2. In the Add Project Output Group dialog box, select Primary output.When Primary output is added to your project, the Crystal Reports assembly filesare added automatically.3. In Solution Explorer, right-click Setup1, point to Add, and then click MergeModule.4. In the Add Modules dialog box, select the merge modules that are required foryour Windows application.For a description of which merge modules to use for different machines, seeAppendix: Crystal Reports Merge Modules for Visual Studio 2005.Copyright 2004 Business ObjectsPage 5

Web or Windows Deployment TutorialsBuilding and Deploying the Setup ProjectBuilding the Setup Project creates an installer that you can deploy to other computers.Note When deploying to other computers, always ensure that the computeralready has the .NET Framework installed.To build and deploy the Setup Project1. From the Build menu, choose Build Setup1.The build process creates installer files: setup.exe and Setup1.msi (name of yourdeployment 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 moreinformation about which binding scenarios need to distribute report files, seeAppendix: Report Files.7. On the target computer, double-click Setup.exe or Setup1.msi to install theWindows application.8. To view the Windows application in deployment, navigate to the installed location,and then double-click the Windows application .exe file.Copyright 2004 Business ObjectsPage 6

Web or Windows Deployment TutorialsAppendix: Crystal Reports Merge Modules for VisualStudio 2005Crystal Reports for Visual Studio 2005 uses merge modules to ensure the correct reportcomponents 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 isspecified in the scenarios may cause deployment problems.For the specified machine and project type, you must add the correct merge modules tothe project.Machine typeProject typeMerge modules requiredx86Windows applications Crystal Database Access.msm Crystal Database Access enu.msm Crystal Managed.msm Crystal Database Access.msm Crystal Database Access enu.msm Crystal Managed.msm Crystal Webformviewer.msm 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 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 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 ---x86AMD64AMD64IA64Web SitesWindows applicationsWeb SitesWindows applicationsCopyright 2004 Business ObjectsPage 7

Web or Windows Deployment Tutorials.msmIA64Web 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 --.msmThe merge modules can be downloaded fromhttp://www.businessobjects.com/products/dev zone/net/VisualStudio2005Beta.Note For more information about merge modules in Crystal Reports for VisualStudio .NET 2002 or 2003, and Crystal Reports 10, please refer to the online help inVisual Studio 2005.Copyright 2004 Business ObjectsPage 8

Web or Windows Deployment TutorialsAppendix: Report FilesCrystal report binding scenarios use either embedded or non-embedded reports.In Visual Studio applications, embedded reports are compiled into the deploymentproject. Deployment projects can then be distributed and deployed without having todistribute report files separately.For applications that use non-embedded reports, the report files are not compiled intothe deployment projects. The report files must be distributed with the projects.For more information about embedded and non-embedded reports, please refer to theonline help in Visual Studio 2005.The following table describes what you must do to successfully distribute and viewdeployment projects that use specific reporting binding scenarios.Report binding scenariosRequirements Binding to a File Directory Path inCode Distribute the report files with thedeployment project. Binding to a File Directory PathThrough the Properties Window Binding to a Non-embedded ReportClass Loaded into ReportDocumentOn the target computer, save thereport files in the path directory that isused in the Web or Windowsapplication. Binding to a Non-embedded ReportClass Loaded into a CacheManagement Utility Class Binding to a Report Web Service URL No need to distribute report files;report files are compiled into theReport Web Service project. Binding to an Embedded Report Class Binding to an Embedded Report ClassUpcast to ReportDocumentNo need to distribute report files;report files are compiled into theproject. Binding to a Cached Embedded ReportClass Binding to Crystal Enterprise (CrystalReports 10) Binding to Report Application Server(Crystal Reports 10) Binding to Unmanaged RAS UsingReportDocument.Load() Method (RAS10)No need to distribute report files;report files are accessed through theunmanaged RAS server. Binding to Unmanaged RAS UsingReportDocument.FileName Property(RAS 10)The unmanaged RAS server that isused in the binding scenarios needs tobe running on the network. Report binding scenario in Binding toUnmanaged RAS UsingReportClientDocument.Open() Method(RAS 9 and up) needs Report Binding to Unmanaged RAS UsingReportClientDocument.Open() MethodCopyright 2004 Business ObjectsPage 9

Web or Windows Deployment Tutorials(RAS 9 and up) Binding to Managed RAS UsingReportDocument.Load() Method (RASwithin CE 10)No need to distribute report files;report files are accessed through themanaged RAS server. Binding to Managed RAS UsingReportDocument.FileName Property(RAS within CE 10)The managed RAS server that is usedin the report binding scenarios needsto be running on the network. Report binding scenario in Binding toReportSource (Crystal Enterprise 10)needs Crystal Enterprise .NET SDKand Crystal Enterprise PublishingWizard to be installed on the targetcomputer. Binding to ReportSource (CrystalEnterprise 10) Application Server to be installed onthe target computer.Binding to Managed RAS UsingReportAppFactory.OpenDocument()Method (RAS within CE 9 andup)Binding to InfoObject Cast asReportNote For more information about each binding scenario, please refer to the onlinehelp in Visual Studio 2005.Copyright 2004 Business ObjectsPage 10

Web and Windows DeploymentAppendix: Project SetupThis section is a key learning point for both advanced and intermediate developers. Itdemonstrates the recommended best practices to follow to create and configure a newWindows project or Web project/site with Crystal Reports for Visual Studio .NET 2002 or2003, and Crystal Reports for Visual Studio 2005.Visual Studio VersionsProject Setup requires different procedures for Visual Studio .NET 2002 and 2003, ascompared to the Project Setup procedures for Visual Studio 2005.Click the appropriate link to jump to the section that corresponds to your version ofVisual Studio: Visual Studio .NET 2002 or 2003 Visual Studio 2005Project Setup in Visual Studio .NET 2002 or 2003In Crystal Reports for Visual Studio .NET 2002 or 2003, both Web and Windowsapplications 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, withonly 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 ControlCreating a New Web or Windows Project in VisualStudio .NET 2002 or 2003Before you create a Web or Windows project, verify that Crystal Reports for VisualStudio .NET 2002 or 2003 has been installed on your system. See Appendix: WhatNeeds to be Installed?.Note Use a Pascal naming convention: set the first letter of the project name touppercase (because the project name also becomes the namespace name for theassembly generated from the project).Creating a New Web Project in Visual Studio .NET 2002 or 2003To set up a Web project in Crystal Reports for Visual Studio .NET 2002 or 20031. 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 BasicProjects from the Project types list.Copyright 2004 Business ObjectsPage 11

Web and Windows Deployment4. From the Templates list, click ASP.NET Web Application.5. In the Location field, replace the default project name with the name of yourproject.The sample below assumes that your server name is http://localhost.[Visual //localhost/MyProjectNameCSharp6. Click OK.Creating a New Windows Project in Visual Studio .NET 2002 or2003To set up a Windows project in Crystal Reports for Visual Studio .NET 2002 or20031. 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 BasicProjects 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 2003A few minor modifications must be made to the project settings to configure the projectto work with the tutorials in this documentation.Note Flow layout uses plain html without pixel placement instructions. Thisgenerates thinner, more readable html code. The use of flow layout has beenadopted in all tutorials and sample code that are supplied with the helpdocumentation.To modify project settings for a Visual Basic project in Crystal Reports forVisual Studio .NET 2002 or 20031. In your Visual Basic project, right-click the project name (the name in bold that isjust below the solution name in Solution Explorer), and then select Properties.2. In the Property Pages dialog box, expand the Common Properties folder, andclick Build.3. On the OptionStrict list, click On.Note As a best practice, it is recommended that you enable OptionStrict at thestart of any Visual Basic project. When you write code, it forces the use of bestpractices with strongly typed variable declarations and valid casting, both ofwhich are checked at compile time. Compile-time checks that are strictlyenforced can reduce run-time exceptions.Copyright 2004 Business ObjectsPage 12

Web and Windows Deployment4. In the same folder, select Designer Defaults. On the Page Layout list, set thevalue 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 .NET2002 or 20031. In your C# project, right-click the project name (the name in bold that is just belowthe solution name in Solution Explorer) and click Properties.2. In the Property Pages dialog box, expand the Common Properties folder, andclick 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.Preparing the Web or Windows Form in Visual Studio.NET 2002 or 2003In this section, you prepare the Web or Windows Form in Visual Studio .NET 2002 or2003.Preparing the Web Form in Visual Studio .NET 2002 or 2003Traditional ASP websites typically defined a default page under the name default.asp. Inkeeping with that pattern in an ASP.NET Web project, you create a new Web Formnamed Default.aspx (and delete the auto-generated Web Form, WebForm1.aspx).To prepare the Web Form in Crystal Reports for Visual Studio .NET 2002 or20031. Delete the WebForm1.aspx page that is generated when the project is created.2. From the Project menu, click Add Web Form.3. In the Add New Item dialog box, in the Name field at the bottom, enter the nameDefault.aspx.4. Click Open.The Default.aspx Web Form (also called a page) appears in Solution Explorer andthe form opens in the main window.5. From the View menu, click Code.The code-behind class for the Default.aspx Web Form ( Default class) appears,which contains a Web Form Designer generated code region.Next, you add a private helper method that is used as the designated location for all thecode that configures Crystal Reports for the class.To add a private helper method for Crystal Reports configuration code1. At the bottom of the class, add a new private scope helper method, with no returnvalue, named ConfigureCrystalReports().[Visual Basic]Private Sub ConfigureCrystalReports()Copyright 2004 Business ObjectsPage 13

Web and Windows DeploymentEnd Sub[end][C#]private void ConfigureCrystalReports(){}[end]Next, you put a call to the ConfigureCrystalReports() method from within anevent method, so that the ConfigureCrystalReports() method runs automaticallywhen the form loads.The ConfigureCrystalReports() method enables users to interact with the reportat runtime. It also controls programmatic interaction with the report.Note The Page Load event method is typically used to enter Web Formconfiguration code in a .NET Web application. However, Page Load is not therecommended event method to use with Crystal Reports. For more information,please refer to the online help in Visual Studio 2005.2. Click the symbol on the Web Form Designer generated code region to expandand display its contents.It is usually best to keep this region collapsed, because it contains auto-generatedcontent that you rarely modify. However, you must add one line of code to thisregion before you collapse it again.3. Within the "Page Init" [Visual Basic] or "OnInit" [C#] event method, andbelow the method call to InitializeComponent(), enter a call to theConfigureCrystalReports() method.[Visual rystalReports();[end]4. Click the - symbol on the Web Form Designer generated code region to collapsethe 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.Preparing the Windows Form in Visual Studio .NET 2002 or 2003Traditional Visual Basic 6 Windows applications typically defined a default form underthe name Form1. In keeping with that pattern in a Windows project, you use the samedefault form name, Form1 with a .cs or .vb extension that depends on the language youuse.To prepare the Windows Form in Crystal Reports for Visual Studio .NET 2002or 2003Copyright 2004 Business ObjectsPage 14

Web and Windows Deployment1. If Form1 is not already displayed in the main window, double-click Form1 inSolution Explorer to open it in Design view.2. From the View menu, click Code.The code view of the Form1 class appears. The display of this class is dependent onwhether your Windows application is coded in Visual Basic or C#.In C#, the Form1 class displays the following: A class-level variable declaration (the components variable). A constructor (Form1). A Dispose() method. A Main() method. A Windows Form Designer generated code region.In Visual Basic, the Form1 class displays only a class signature and the WindowsForm Designer generated code region.Next, you add a private helper method that is used as the designated location for allcode that configures Crystal Reports for the class.To add a private helper method for Crystal Reports configuration code1. Add to this Form1 class a new private scope helper method with no return value,named ConfigureCrystalReports().[Visual Basic]Private Sub ConfigureCrystalReports()End Sub[end][C#]private void ConfigureCrystalReports(){}[end]Next, you put a call to the ConfigureCrystalReports() method from within theclass constructor, so that the ConfigureCrystalReports() method runsautomatically when the form loads.Note The class constructor for Visual Basic, New(), is contained within theWindows Form Designer generated code region. You need to expand this regiontemporarily in Visual Basic to have access to the class constructor. After youhave finished your modification, it is recommended that you collapse this regionand place your code within the ConfigureCrystalReports() method.2. Within the class constructor New() [Visual Basic] or Form1() [C#] and below themethod call to InitializeComponent(), enter a call to theConfigureCrystalReports() method.[Visual Basic]ConfigureCrystalReports()[end]Copyright 2004 Business ObjectsPage 15

Web and Windows Deployment[C#]ConfigureCrystalReports();[end]Note If you use Visual Basic, you can now collapse the Windows Form Designergenerated code region.3. From the File menu, click Save All.Adding a CrystalReportViewer Control in VisualStudio .NET 2002 or 2003You are now ready to add a CrystalReportViewer control to your Web or Windows Form,to enable you to display reports on the form.To add a CrystalReportViewer control in Crystal Reports for Visual Studio .NET2002 or 20031. Open the Web or Windows Form in Design view.2. From the Toolbox, locate the CrystalReportViewer control.Note The CrystalReportViewer control is generally located at the bottom of thelist of controls. You may have to scroll down to find it.3. Drag and drop the CrystalReportViewer control onto the form.Note When you add the CrystalReportViewer control, the References folder inSolution Explorer expands to show that a number of Crystal Reports assemblieshave been automatically added to the project.4. Click the CrystalReportViewer control to select it.5. From the Properties window, set the ID or Name property: For Visual Basic projects, set the ID property (Web Form) or Name property(Windows Form) to myCrystalReportViewer. For C# projects, set the ID property (Web Form) or Name property (WindowsForm) to crystalReportViewer.6. For either Visual Basic or C#, if you are working in a Windows project, from theProperties window set the Dock to Fill (either by selecting the middle square ofthe Dock selection graphic, or by typing "Fill" into the field).NoteThis causes the CrystalReportViewer to fill the entire Windows Form.7. From the File menu, click Save All.8. From the View menu, click Code.The code-behind class for the Web or Windows Form appears.Next, you declare a namespace, to provide access to the SDK.9. Above the class signature, add an "Imports" [Visual Basic] or "using" [C#]declaration to the top of the class for the CrystalDecisions.Shared andCrystalDecisions.CrystalReports.Engine namespaces.[Visual Basic]Imports CrystalDecisions.CrystalReports.EngineImports CrystalDecisions.Shared[end]Copyright 2004 Business ObjectsPage 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 VisualStudio .NET 2002 or 2003.Project Setup in Visual Studio 2005In Crystal Reports for Visual Studio 2005, the structure of Web and Windowsapplications is no longer parallel: Web applications are no longer built as projects. They are now built as Web Sites.This means that for Web applications the project metaphor is gone. The contents ofa Web Site folder are now simpler than that of a Windows project. In particular, theconfiguration information previously spread across project and global files has eitherbeen removed altogether or else relocated to the Web.config file. Windows applications continue to be built as projects.Click the appropriate link to jump to that section: Web Site Setup Windows Project SetupWeb Site Setup in Visual Studio 2005This section is a key learning point for both advanced and intermediate developers. Itdemonstrates the recommended best practices to follow when you create and configurea new Web Site with Crystal Reports for Visual Studio 2005.This section demonstrates Web Site Setup using a coding model. As part of this setup,you will go into the code-beside class and enter code. This code-based Web Site thatyou create serves as a prerequisite for the coding tutorials that are provided with thisonline help.The procedures in this section must be completed in succession: Creating a New Web Site Preparing the Web Form Adding a CrystalReportViewer ControlCreating a New Web Site in Visual Studio 2005Before you create a Web Site, verify that Crystal Reports for Visual Studio 2005 hasbeen installed on your system. See Appendix: What Needs to be Installed?.To set up a Web Site in Crystal Reports for Visual Studio 20051. Launch Visual Studio 2005.2. From the File menu, select New, and then click Web Site.Copyright 2004 Business ObjectsPage 17

Web and Windows Deployment3. In the New Web Site dialog box, select a language folder for C# or Visual Basicfrom 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\MyProjectName6. Click OK.Preparing the Web Form in Visual Studio 2005When you create a new Web Site, a Default.aspx page is automatically generated. ThisDefault.aspx page defaults to the inline code model used by traditional ASP. Whilefamiliar to ASP users, this model prevents the separation of the presentation layer fromthe business logic. These instructions guide you to use the alternative model wherecode is placed in a separate file.To prepare the Web Form in Crystal Reports for Visual Studio 20051. Delete the Default.aspx page that is generated when the project is created.Note You need to delete the Default.aspx page so that you can recreate yourown version of this page, with the code stored in a separate file.2. In Solution Explorer, right-click on the bold Web Site name and select Add NewItem.3. In the Add New Item dialog box, select Web Form in the Standard Templateslist.4. In the Name field, enter the name Default.aspx.5. Select Place code in separate file.6. Click Add.The Default.aspx Web Form is added to Solution Explorer. The form opens in themain window in Source view.7. From the View menu, click Code.The code-beside partial class for the Default.aspx Web Form (Default aspx)appears.8. If you develop in Visual Basic, type "Option Strict On" at the top of the code view.Note As a best practice, it is recommended that you set Option Stri

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