How to use Crystal Report 9.2 in Delphi 7
Li Jingtong
date
Version Description Note 2004-3-12 0.1 New construction of Crystal Report 9 VCL in Delphi 7
table of Contents
First, use Crystal Report 9.2 Dynamic Library ... 2
1. Develop environmental installation precautions ... 2
2, introduce Crystal Report Viewer control in Delphi 7 ... 2
Second, Crystal Report 9.2 VCL installation ... 3
1. Prepare the appropriate VCL components ... 3
2, install VCL. 3
3. Problems used in VCL components ... 6
4, modifications in the VCL components ... 7
Third, using Crystal Report 9 VCL programming ... 7
1. Use VCL writing procedures ... 7
2, simple connection data source code implementation - only using TCRPE32 components to meet our needs ... 8
3, complex data source implementation - requires TCRPEDs to assist in achieving data sources ... 8
4. Problems encountered in handling ... 11
Fourth, how to release your own procedure ... 11
1. Use InstallShield DevStudio 9 to make installations ... 12
2, run library description ... 12
3, some problems encountered ... 14
Five, summarize ... 14
First, how to release your own procedure
When we have completed the program, the last task is to publish our program, but because Crystal Report has a lot of libraries, it has brought a lot of trouble to our publishers, so that we publish the program on the client. You cannot use it normally, you will introduce how to release procedures, as well as often encounter problems:
1. Use InstallShield DevStudio 9 to make installations
In InstallShield DevStudio 9 already has Merge Modules, but that is English, it is not able to meet our needs, we need to download Simplified Chinese, replace. Download address: http://support.businessObjects.com/communitycs/filesandupdates/cr9rdcmergeModules_chs.zip.asp? Recdnlreq = record & DNLPath = Cr9rdcmergeModules_chs.zip.
· Download the corresponding file in the / program files / common files / merge modules after downloading.
• Select the Crystal Report 9-Crystal Report Engine Components to join our installer.
· If you use TClientDataSet, you need to add Midas.dll.
· Need to join crpe32.dll, crpe32_res_chs.dll, gdiplus.dll, commonobjmodel.dll, rptobjmodel.dll, u2fcompress.dll
· More programs feature feature add to other library files.
2, the runtime explanation
Although Crystal Decisions stipulates that Crystal Reports Components supports multiple versions to be installed on the same machine, it does not support this, and a series of issues will occur during the actual application.
When publishing your own procedures, there is a few aspects depending on the Crystal Report Runtime:
- Method for accessing Crystal Report Engine
- Data source used by reports
- Export type support
- Other features, such as charts, maps, formulas support. Four main devices in Crystal Reports Components:
- Craxdrt9.dll - The Crystal Reports 9 ActiveX Designer Runtime DLL. This DLL IS The Reporting Engine and It Exposed The Object Model Hierarchy. Distribute this DLL with All Applications Using The RDC.
- CRVIEWER9.DLL - The Crystal Reports View Control. Use this Component to Preview Your Report. If you are not previewing the report, The IT IS Not Necessary To Distribute this DLL.
--CRDesignerCtrl.dll -. Embeddable Crystal Reports 9 Designer Control This DLL exposes report creation and designer capabilities in your application and allows you to create a report at runtime using an ActiveX designer.
--Craxddrt9.dll -. Crystal Reports 9 ActiveX Designer Design and Runtime DLL This DLL is the engine used to design and format reports at design time, as well as to access and process reports at runtime.
Although Crystal Report provides a installation package, there are many files in the installation package, and many of us do what we need. We can pick the library files you need to join the installer, main reference Program Files / Crystal Decisions / Crystal Reports 9 / Developer files / help / chs / runtime.chm help file.
· Main demand files
Craxdrt9.dll: Mfc42.dll, Msvcrt.dll, Msvcp60.dll, Comdlg32.dll, Comctl32.dll CRViewer9.dll: Comctl32.dll CRDesignerCtrl.dll: Msvcrt.dll, Comctl32.dll Craxddrt9.dll: Mfc42.dll, Msvcrt .dll, msvcp60.dll, comctl32.dll, comdlg32.dll, msvcirt.dll
· Require C & C runtime
--MFC42.DLL (Version 6.0.8447.0 or higher)
--Msvcrt.dll (Version 6.0.8397.0 or higher)
--Msvcp60.dll (Version 6.0.8168.0 or higher)
· Other system libraries
COMDLG32.DLL --COMCTL32.DLL --Riched20.dll --USP10.DLL
· Crystal Report Runtime file requires the following files and operations:
--Run cr9deploy.reg; (or modify this file to where you will have your bin folder, the rest of this article assess That the bin folder location is "c: / program files / compon files / crystal decision / 2.0 / bin" Refer to 'runtime.chm' and look Under 'Side-by-Side Installation' for more information .-- Copy Unicows.dll to "C: / Program Files / COMMON FILES / CRYSTAL DECISIONS / 2.0 / BIN". INCLUDE UNICOWS .dll (Version 1.0.3703.0 or Higher) Into Distributions That Are Targeted for Windows 9x Computers. for more information, refer to knowde base article c2011871
--Copy craxdrt9.dll to "c: / program files / compon files / crystal decision / 2.0 / bin" (Register this file using regsvr32.exe)
--Copy The Following Dependency Files To "C: / Program Files / Common Files / Crystal Decisions / 2.0 / bin"
- IMPLODE.DLL (for Applications Using Reports Created in Versions Previous To Crystal Reports 8)
- QueryBuilder.dll
--Ufmanager.dll
--Atl.dll (There are two versions of Atl.dll one for Win9x and another for WinNT / Win2000. Please refer to special instructions in 'Runtime.chm' and look under 'Additional Components' and then 'Paged-ranged export' for more information.)
--Copy crqe.dll to "c: / program files / compo files / crystal decision / 2.0 / bin" (Register this file using regsvr32.exe)
--Copy keycode.dll to "c: / program files / compo files / crystal decision / 2.0 / bin" (Register this file using regsvr32.exe)
· If you need to allow you to view the report below, you need the following:
--Copy crviewer9.dll to "c: / program files / compon files / crystal decision / 2.0 / bin" (Register this file using regsvr32.exe)
· If you need the ability to design a report template in the program, you need to do the following:
Copy Crdesignerctrl.dll to "C: / Program Files / Common Files / Crystal Decisions / 2.0 / bin" (Register this file using regsvr32.exe) - Copy Craxddrt.dll to "C: / Program Files / Common Files / Crystal Decisions / 2.0/bin "(Register this file usning regsvr32.exe)
· Active Data
If you need to use Active Data (ADO, CDO, DAO, RDO, ETC), you will need to join the library files accessed by the database.
· Database DLLS
If the program is not active data connection, but the database file (such as Access Table, etc.) requires CRDB_ *. DLL OR P2 * .DLL corresponding library file support.
· Export DLLS
Select the export DLL file according to your own needs.
3, some problems encountered
· Export HTML problem (although we add a lot of library files, finally find that HTML cannot be used normally), we need to check if the next library file is all included.
Check: Program Files / Common Files / Crystal Decisions / 2.0 / bin:
--Crxf_html.dll
--Reportrenderer.dll (Register this file using regsvr32.exe)
--PageObjectModel.dll (register this file using regsvr32.exe)
--Webreporting.dll (Register this file using regsvr32.exe)
--Commonobjmodel.dll (Register this file using regsvr32.exe)
- RPTDefmodel.dll (Register this file using regsvr32.exe)
--U2fcompress.dll
--DATADEFMODEL.DLL
--Gdiplus.dll (Due to licensing restrictions, you must get gdiplus.dll from the Microsoft web site. Go to http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdkredist.htm and select "GDI RTM" ).
In the Crystal Report installation package, there is already a file with crxf_html.dll, reportrendeler.dll, webjectmodel.dll, webreporting.dll, we need to join U2Fcompress.dll, CommonobjModel.dll, RPTDefmodel.dll, Gdiplus.dll four The file can solve the problem of exporting HTML.
If there is a custom function in the report, you need to add a U2 * .dll (UFL) library file.
· After the program is installed on the client, it is found that the report with charts cannot be displayed normally. You need to copy the sscsdk80.dll in the Program Files / Common Files / Crystal Decision / 2.0 / bin to Windows / Winnt / System32, because possible customers The machine contains the old version of SSCSDK80.DLL, you need to copy the new version of the file below the system directory.
Second, summary