Imitation of a report tool for PowerBuilder

xiaoxiao2021-03-06  17

Imitate a report tool for Powerbuild

Imitation PowerBuild's Report Tools Because the routines found online still use drawtext () to write a sentence, it is not convenient, others say money, it is not interested in it, so I mimic PB's DataWindow Writing this report tool. The program mainly includes 4 classes 1. ADOXXXX is a database class written by others, and how to use it to ask the author. 2, CPREGRAPHIC is a class, DrawText (), etc. 3, CPREPRINT is a class of control printers, CPrintDialog, etc. 4, CDATAWIN is the main class of implementation, it converts VC to the window designed in the IDE interface into a report, see Fig. How to use: 1. Add all files in the ADO, DataWin directory 2, join the support app :: initInstance () joining Coinitialize () in the app :: initInstance () Add COUNIZE (); 3 Generate a CDATAWIN CDATAWIN M_DLG; m_dlg.create (IDD_DIALOG1, THIS); // Create m_dlg.init (); // m_dlg.setdouBleram (TRUE); // Dual cache, improve display speed // m_dlg.setPrintView FALSE); // Whether analog display crect rect; // positioning getClientRect (& Re); Rect.deflateRECT (10, 50, 10, 50); m_dlg.moveWindow (Rect, false); m_dlg.showwindow (sw_show); 4, Perform a print m_dlg.onprint ("Title1"); // Print the project name, and there is no relationship with the technical details to join three prograices in the IDE window, divide the window into 4 areas (top head, gauge, tail, page tail). After generating the window, CDATAWIN will take out the position, type, etc. of all controls in the window, and then hide the control. CDATAWIN connects the database based on this information, takes out the data and displays or prints it. a) Title is the name of the SQL command b) = Name et al. Database table item Name C) Others are generally displayed. The main initialization function init () includes the following functions: initgraphic (); // Create a drawing class resetall (); // Reset all variable initBase (); // Modify the window style, initialize the paper fnenumControl (); // Enumerate all children Window IF (! Init4control ()) Return False; // Initialization Window Structure InitConnect (); // Connect Database Open (M_Strdefsql); // Open Table UpDateRecord (); // Load Database Data ShowWindow (SW_SHOW); // The control in the display window is converted into a unified CDATACELL structure, just like a project in Grid. ONPAINT () onpagestart () onPaint () onpagestart () // when refresh window is refreshed, and you can inherit these functions, thereby changing the display content onpageend () // format, or disables it. Supplement: There is a large number of coordinate conversion operations, which don't understand, as long as you modify CDATACELL in OnCellStart () can achieve different effects.

Simple expansion class CDLG1 is to let the ID display red. Rendering Figure 1

Download address: ebug.ys168.com

转载请注明原文地址:https://www.9cbs.com/read-41022.html

New Post(0)