The needs of the project, to use Crystal to do the report, the crystal report function is powerful, the report is beautiful, but it often encounters some problems during use, very trouble, the most intuitive is the help of the software Sometimes Will mislead you. Below I will show me this experience, so as to avoid my bending path.
My development environment is Win XP Professional Visual Studio for .NET 2002 Crystal for .NET.
First, the design procedure, design report RPT, regarding how to design reports, this is a very complicated thing, but in this is not a problem, it is not the focus I want to narrate, anyway, I designated a DOTNET WINDOW that can show reports in the above environment. Application, running normally in this development environment.
I tried to make this program into a MSI installation file, then deployed to a machine without Visual Studio for .NET 2002 Crystal for .NET. The process is like this:
1. Creating a new installation item in the current current solution in VS.NET.
2. Add a project output to add the main output of the program item.
3. The system will contain the relevant dependencies of this introduced items to the "detected dependent" folder, which will be packaged into the MSI.
4. Build
Therefore, the system will automatically detect the components involved in Crystal For .NET. After packaging, go to the target machine installation (three target machines, which are Win98 Second Edition, Win XP Professional), the result three When the machine is installed, the result is the result. When the report is displayed, an error occurred:
Cannot Find Keycodev2.dll, or Invalid Keycode
Find the MSDN with the VS.NET strip and discover the instructions for deploying the Crystal Reports running:
When distributing applications, you must determine the Crystal Decisions file you need in your installation. The files you have to include depends on whether you use charts, maps, and other formula language functions in the report, but also depends on the data sources used in the report and the export options you wish to provide end users. Fortunately, if you are using Microsoft Installer (MSI), you can simplify distribution in your installation module (MSI).
The MSI merge module can be found in the "C: / Program Files / Common Files / Merge Modules" directory. Depending on the components and languages you are being distributed, you can use different merge modules. These merge modules are divided into three categories: managed components, database access, and key numbers.
Managed Components MSM processes the distribution of all managed components, including Windows Forms Viewers, Web Forms Viewers, and all Crystal Decisions namespaces. For all other files required to run the report, access the MSM from the database to distribute it. These include databases, export, and chart drivers. The Keycode MSM handles the installation of the Crystal Decisions key number so that your user will not be required to register their Crystal version when viewing the report.
Specific steps:
1. Open the Windows application.
In the Solution Explorer, right-click on the Windows application solution, point to Add, and then click New Project.
In the Add New Project dialog, select Install and Deploy Projects in the Project Type pane, then select Install Projects in the Template pane. Click the "OK" button. In the Solution Resource Management, right click on the installation item, point to Add, and then click Project Output.
In the Add Project Output Group, select "Main Output" and click OK.
All dependencies are automatically added, such as Managed.MSM.
In the Solution Explorer, right-click the installation item, point to Add, and then click Merge Module.
In the Add Module dialog box, select the following to add the merge module to the installation item, and then click Open:
Database_access.msm
Database_access_enu.msm
RegWiz.MSM
VC_CRT.MSM, VC_STL.MSM (if you deploy Windows application uses the ADO.NET dataset, you also need to include VC_CRT and VC_STL merge modules)
In the Solution Explorer, right-click the RegWIZ.MSM file and select Properties.
In the Properties window, expand MergeModuleProperties, and then enter a valid license key (key AAP5GKS0000GDE100DS) in the License Key Properties box.
Note You must provide a license key whenever a Crystal Reports application is deployed.
From the Generate menu, select Generate Solution to generate an application.
The MSI installation file is made according to the steps described above, and the target machine is deployed again (when deploying to the client or server), it should always be ensured that the computer is installed .NET Framework. It is also installed to the above WIN98 second edition, Win2000 Server, Win XP Professional, the result is:
1. Win98 Second Edition, WIN XP Professional These two machines are running normally, and the report shows normal, and the report export is also normal.
2. Win2000 Server machine is installed, and the report is normal, but once the export icon in the report monitor is clicked, the entire program will die, and "unat" is displayed in the task manager, it can only be turned off.
This result is barely acceptable, and this program is not running in Win2000. However, a new problem is found, that is, the exported Word document is not strict, there are some differences, and this difference has been unbearable:
1. The text in the table in the report monitor is normal, and the text in these tables in Word is converted into a picture box, but the conversion is high, resulting in a small portion of the displayed text. It doesn't show it, the effect is that a line of words have been eaten below.
2. A report is displayed in the report monitor, the margin is very accurate, but the exported Word document, the end of the report is outside the page. The page settings are A4 when designing the Crystal report, and the estimate is exported to the Word document, the size of the paper changes, not A4, "" page setting "of the exported Word document is dark, not allowed to modify.
The report in this software must be exported to Word, such an export effect is unacceptable, so I think is that it is trying to upgrade to crystal9.
Crystal9 is fully supported by DOTNET. Crystal Reports 9 integrates its feature into the Visual Studio .NET Integration Development Environment (IDE), which enhances the development performance of Visual Studio .NET (VS .NET) in place of the original Crystal Reports for .NET . The Crystal Report 9 Advanced EDTION Chinese version is installed. See the help of vs.net About, seeing the information of Crystal is displayed as: Crystal Reports 9 for Visual Studio .NET, successful upgrade.
Re-compile the program, run the program on the development machine, the report is normal, mainly to see if the Word document display is normal, click the Export button in the Report Display, and export the Word document, the result is the report displayed in the Word document. Like the same, the heart is dark, the problem is solved.
OK, now you have to deploy the question.