Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-10

Tip for Print Preview

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Edilson Vieira

Hi there!

I have just written a generic printing routine to print selected lines of a dbgrid using a default layout to use in my apps where a specific layout is not needed. For that I use the TPrinter object.

My objective is to port a big app in Delphi to Lazarus but it has many QuickReports so I am replacing such code with this routine where the layout is not an issue.

I am attaching the full source code in a text file (PrintLib.pas, 530 loc) in case it is useful to someone.

To use it just call the procedure bellow:

procedure PrintSelected(aTitle: string; aDBGrid: TDBGrid; aLogoImage:
TImage);

The Title is a string to be printed on left top corner of each page. The DBGrid is assumed to have Multiselect in Options, all selected lines will be printed.
The TImage is for a logo or something alike and is printed on right top corner of each page.

I am not using LazReport yet because I need the app running in Delphi for a while. I plan to use it for the more complex reports.

I just have a question if someone could give me a hint on how to make a form preview of such printing that could be easyly ported to Lazarus.

Wich object shoud I use for this purpose?

Please ignore this message if it is off-topic.

Thanks in advance.

[]'s,

Ed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131030/c00e3678/attachment.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: PrintLib.pas
Type: application/octet-stream
Size: 16018 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131030/c00e3678/attachment.obj>

Reply by email