Report is the most important thing I feel in my computer room charging system: Calm down.
Report use process: download and install grid ++ report --> Design Report Template (this involves the connection between reports and databases) --> Configure the development environment (Vb-project-component-control 'grid ++ report engine5.0 Type Library 'is selected and added to the toolbox .) --> Interaction between VB and reports.
One of the features of grid ++ report is the Centralized implementation of the functions of screen query, display, print, preview, and data export of reports.
1. Print and print the preview function
Define the main object of a report
Load Report Template: loadfromfile method code: Report main object. loadfromfile ("c: \ Program
Files \ grid ++ report 5.0 \ daily report. GRF ")
Code for joining the Data source: Report main object. Get detail grid (). Get Dataset
(). Link string = connectionstring
Code of the print button: print method specific code: Report main object. Print (true)
Code of the print preview button: main object of the printpreview method report. printpreview (true)
2. Display reports in the query Display Control
Insert a REPORT query display (grdisplayviewer) control in the window
In a dataset, associate the report main object with the query display control. Call the "Set Report/setreport" method of "query display/grdisplayviewer" to associate the query display control with a report object. Code: grdisplayviewer1.setreport (Report main object)
Run the query display control: Call the "Start/start" method of "query display/grdisplayviewer" to start the query display control.
Code: grdisplayviewer1.start ()
3. query statement settings
Report. Get detail grid (). Get dataset (). query SQL = "select ...... "
4. Release
Applications developed using grid ++ report should include the final user release file of grid ++ report at the same time during release. The files to be re-distributed are only two DLL files: gregn50.dll and grdes50.dll.
Manually register a publishing File
Regsvr32.exe is a tool for registering COM objects in windows. It is included in each Windows version. If the applications developed with grid ++ report are distributed to the target computer, the two release DLL libraries of grid ++ report are not self-registered during installation, you must use the regsvr32.exe program for registration. In the command line window, run the regsvr32 command.
Regsvr32 "% filepath % \ gregn50.dll"
Regsvr32 "% filepath % \ grdes50.dll"
Register DLL using batch processing
Create a TXT text program named "Reg. Bat", which is a batch file name.
Edit the batch file content as follows:
Regsvr32 gregn50.dll
The content of the batch file for canceling registration is:
Regsvr32/S/u gregn50.dll