20-04-2013, 04:54 PM
Crystal Reports 10 and .NET
Crystal Reports.pdf (Size: 63.17 KB / Downloads: 239)
[b]Introduction[/b]
Crystal Reports for Visual Studio .NET extends the powerful reporting capability of
Crystal Reports on the Microsoft .NET platform. You can use the integrated Crystal
Reports Designer in Visual Studio .NET to create a new Crystal report or modify an
existing Crystal report. You can then keep the report on a local computer, or publish it as a
Report Web Service on a Web server. Depending on whether you develop a Windows or
Web application, you can host the report with either the Windows Form Viewer or the Web
Forms Viewer respectively.
In addition to building Windows and ASP.NET Web applications using CR for VS .NET,
you can build enterprise solutions used to view reports from CE Embedded (RAS) 10 and
Crystal Enterprise (CE) 10.
Deploying Reports in Visual Studio .NET Applications
When reports are added to a .NET Windows or Web application, they are added by default
as an “Embedded Resource” for the application. What this means is that the report will be
compiled into the assembly’s manifest, and will not be loaded from a separate report file
(.RPT).
This allows Visual Studio .NET applications to be distributed and deployed without having
to distribute report files separately. The advantage of doing this is that applications do not
have to deploy external report files and end users cannot modify them. The disadvantage is
that if a report needed to be modified, the entire application needs to be recompiled and
redeployed for the report changes to be saved.
To avoid reports being compiled into the assembly’s manifest as an embedded resource,
change how the report is saved in the project. After adding a report to a project, highlight
the report in the Solution Explorer window and from the Properties Window change the
Build Action property from Embedded Resource to None. Building this project will not
compile the report into its assembly and reports will have to be loaded from disk. Reports
can be loaded by specifying a file path using the .Load() method of the ReportDocument
object.
Overview of Deployment Scenarios
There are two scenarios for deploying the Crystal Reports 10 runtime files to a deployment
machine:
• Using merge modules - Merge modules are provided for those developers who want to
include the Crystal Reports 10 runtime files along with the install package for the
surrounding application.
• Using the server install (interactive install) - The server install is provided for those
developers who simply want to deploy the files to a target machine as a standalone
task.
If your application requires a RAS server, run the Crystal Enterprise Embedded Edition
install on your deployed server.
Crystal Reports 10 Merge Modules
There are four different Crystal Reports merge modules to choose from. These merge
modules are designed to fit into different core scenarios so in most scenarios only one of
the merge modules will be required in any single setup package.
Adding multiple merge modules may cause your application to not deploy properly.
However, the one exception is with the Mapping merge modules, which can be used in
combination with any of the other 3 merge modules