<div dir="ltr"><div><div><div><div><div><div>Hi there!<br><br></div>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.<br>
<br></div><div>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.<br></div><div><br></div><div>I am attaching the full source code in a text file (PrintLib.pas, 530 loc) in case it is useful to someone.<br>
<br>To use it just call the procedure bellow:<br><br>procedure PrintSelected(aTitle: string; aDBGrid: TDBGrid; aLogoImage: TImage);<br><br></div><div>The Title is a string to be printed on left top corner of each page.<br>
</div><div>The DBGrid is assumed to have Multiselect in Options, all selected lines will be printed.<br></div><div>The TImage is for a logo or something alike and is printed on right top corner of each page.<br></div><div>
<br></div>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.<br><br></div></div>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. <br>
<br>Wich object shoud I use for this purpose?<br><br>Please ignore this message if it is off-topic.<br><br></div><div>Thanks in advance.<br><br></div>[]'s,<br><br></div>Ed.<br><div><div><div><div><div><div><br></div></div>
</div></div></div></div></div>