Unit PrtwwGrd

TPrintwwGrid v3.1ww November 5, 1997 Changes by Tom Jensen, CIS: 100244,752 (search for *tj*) Internet: tomjensen@albury.net.au - Fix calculation of column positions that resulted in the loss of the first or last character of the column heading. July 17, 1997 Changes by Tom Jensen, CIS: 100244,752 Internet: tomjensen@albury.net.au - fixed 'An error occured during this operation' when executing PrintDialog - fixed location of print file. - Added ColScale property to allow a scaling of the width of the printed columns to approximate the width of the screen columns. With an MS San Serif 8 font, a scaling of 55 (55%) gives a good approximation. } {April 11, 1997 Changes by Roberto Nahum, r.nahum@agora.stm.it, http://ourworld.compuserve.com/homepages/gmedia/, +39-6-6634568 fax, to install and operate in Delphi 2.0. March 28, 1997. Paul Rice, Intelligent Business Forms ibforms@msn.com; (703) 716-0772 voice; 716-0773 fax TPrintwwGrid v3.0bww We were really tired of not being able to get a decent printout of InfoPower grids. Now we're just tired. ;-\ P.S. Eric, I couldn't get your e-mail address to work. Intelligent Business Forms and Paul Rice cannot and do not warrant that the contents of this software will operate error free. The risk associated with the performance and quality of this software remain entirely with the user, who assumes responsibility for the installation, use, and results obtained from the software, and all other use thereof. Intelligent Business Forms and Paul Rice make no warranty, either express or or implied, including, without limitation, any warranty with respect to this software, its quality, performance, or fitness for a particular purpose. In no event shall Intelligent Business Forms and Paul Rice be liable for damages, whether direct or indirect, incidental, special, or consequential, arising out of the use of or any defect within this software, even if Intelligent Business Forms and Paul Rice have been advised of the possibility of such damages, or for any claim by any other party. Intelligent Business Forms and Paul Rice specifically disclaim all other warranties, representations, or conditions, either express or implied, including but not limited to, any implied warranty or condition of merchantability or fitness for a particular purpose. Dedicated to my babies, Melissa Sue and Frederick Mozart Rice.} (* PRTGRID.PAS -- TPrintGrid v3.0b. Update as of Mar 22, 1997. This minor update fixes some bugs and adds a few new features. Nothing of any Earth-shaking importance, but it does make a nice VCL a little nicer. Thanks to these folks who helped fix bugs and add new features: - Rene' Schwietzke. Nov 29, 1996 - new features - Steve Turner - the best fix for the "range error"/GPF regarding the check of the printer orientation. Several others also sent fixes for the printer orientation bug, but Steve's seemed like the best solution. Changes since v3.0: - FullPage property added; lets you choose to print a full page, or only the used part (Page number stays at bottom) - RowLine now prints a line after the last record, if you are using lines between each row of text - If the printed text line is wider than the paper, a user dialog now comes up asking if user wants to cancel the print - Some printer drivers caused a "range error"/GPF when the VCL checked the printer orientation. This has been fixed by Steve Turner. *) (* PRTGRID.PAS -- TPrintGrid v3.0b. This is a Delphi v1 component that lets you print a DBGrid. Public domain by Eric W. Engler. Mar 21, 1997. User can select DPI and Orientation using the std printer configuration dialog. As this code is now, there will be slight variances in sizing and proportions for different DPI settings, but it will look acceptable. I have tested with 300 and 600 DPI laser printers, but I haven't tested with 1200 DPI yet. I think the user can chg printers via the dialog at run time and this will still work OK, but I haven't tested this. This will need modifications if you modify a DBGrid to allow multi-row column headers or data values (or if you embed bitmaps), but most owner-draw code added to the grid to control colors won't conflict with this component. By the way: this component goes along nicely with the TDBSearch component, which searches for text in grids. *) (* to do: 1. chg HorizGap to a percentage of a char size using detail line font 2. Although VertGapPct is already supposed to be based on a percent of char size, I had to tweak it in a DPI-dependant manner to get reasonable sizing at both 300 and 600 DPI. Why? 3. Change margin specs to a DPI-independant measurement, instead of pixel counts (perhaps keyed to detail font char size; or if you feel agressive, tie them to inches. Pay attention to Orientation and paper size differences). 4. Make sure that all sizing formulas produce identically- sized and proportioned reports at both 300 DPI and 600 DPI (and up!). As I said, this now works much better but it's output isn't identically sized at 300 and 600. 5. Automatically default Orientation depending on how wide the grid is. Also, perhaps you want to use larger fonts for the printed report if the screen grid is small. Maybe call this an "autolayout" property? 6. Perhaps the "Print to File" option should bring up a dialog box giving format options like quoted comma-separated fields, etc.

Classes

TPrintwwGrid -

Functions

Register -

Types

TPageNumberPos

Constants

MaxCols
MaxPages

Variables


Functions


procedure Register;


Types


TPageNumberPos = (pnNone,  pnTopLeft, pnTopCenter, pnTopRight,
                     pnBotLeft, pnBotCenter, pnBotRight);

Constants

MaxCols = 100

MaxPages = 1000


Variables