>Hello, friends. I use Delphi 7 and Windows. To generate reports, I've 
>been using some report tools, like Rave or Report Builder. But, for the 
>first time, I need to generate a report with many lines, rectangles, 
>circles, and other draw elements, depending on some DataBase values. 
>I've read about TPrinter and TCanvas at Delphi's help (which seems to 
>me I'll have to use on this case), I've understood all drawing methods, 
>but it's not yet clear how to use it. When user clicks a button, the 
>program will show this kind of report at screen and optionally send it 
>to a printer. Could someone give me a good track to do it?

We do not use 3rd party reporting tools, like Crystal, Report
Builder, etc., mainly because we prefer to have complete
control of the result. I started out using Crystal years ago
and quickly found that I spent a lot more time trying to
figure out how to get a desired result from Crystal than if
I just did the drawing commands myself in code.

Drawing to the printer is exactly the same as drawing on
the screen. The difference is that the drawing is mostly
done in pixels and the printer canvas is very large compared
to the screen in pixels. What we did to make this easier
is write our own library of code that automatically scales
all the drawing commands to a unit of measure, like inches.

When you do this in your own code, you need to calculate
how many pixels it takes to draw, for example, a one inch line.
This will vary with the printer because printers have varying
resolutions. Some are 300 DPI, 600 DPI, or 1200 DPI. So
to draw the one inch line on the 300 DPI printer your LineTo
command is 300 pixels from the origin. There are printer
escapes in the Windows API that will return the X and Y
DPI of the printer. You can then use those values to scale
your pixel values.

HTH,

Glenn Lawler
www.incodesystems.com



------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to