| RTL reference|Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link To |
| Quick Reports Tutorial | ||||||||||||||||||
| Page 9: Printing without using Quick Report components; Setting Trays and other printer features | ||||||||||||||||||
Printing without using Quick Report components In this example we have a button which is used to start the printing process. You need to add Printers to the uses clause of the form. The Printer is the object you are directing your output to. BeginDoc is used to open the file for printing. You can change the style of the printing by accessing the printer.Canvas. In this example we are changing the Font size to 12. Next we are printing at certain places on a page the numbers 1 to 8 (I) using the canvas.textout. the number 572 is the number of Pixels needed to move approximately 1 inch. It is not a fixed number but can change with the type of printer. Theoretically it is the number of dots per inch (DPI). The first variable in the Canvas.text out is the X coordinates, the second is the Y coordinates and the last is the text itself.
Because you are creating the page and then sending it to the printer using the EndDoc command, you can position your text all over the page in the manner that is most convenient for you. Here is an example:
In this case, the same text is placed on two places (170 and 2500 Pixels) on the same line.
Setting Trays and other printer features If you need to use a different printer than the default you may have to change the default printer programmatically, run your report and then change it back. Here is some sample code to do this:
Other Resources 1. The QR samples found in the Demos subdirectory of Delphi.
2. The manual and other tutorials which are in the Downloads section of QuSoft.com or QuSoft.No web sites.
Don't forget to post your questions, concerns, views and comments to this article on the Delphi Programming Forum.
First page > Report Overview and Philosophy > Page 1, 2, 3, 4, 5, 6, 7, 8, 9
|
||||||||||||||||||
All graphics (if any) in this feature created by Zarko Gajic.
| More Delphi |
|
· Learn another routine every day - RTL Quick Reference. · Download free source code applications and components. · Talk about Delphi Programming, real time. · Link to the Delphi Programming site from your Web pages. · Tutorials, articles, tech. tips by date: 2001|2000|1999|1998 or by TOPIC. |
|
· NEXT ARTICLE:
Your application will be shut down!. Access violations, invalid page faults, general protection faults; the name changes, but the nature of the problem is always the same. Find the solution to your Delphi AVs. |
| Stay informed with all new and interesting things about Delphi (for free). |
|
|
| Got some code to share? Got a question? Need some help? |

