Solved

Printing TDrawGrid

Posted on 2002-07-07
6
277 Views
Last Modified: 2010-04-04
I am trying to print a TDrawGrid, however, I cant seem to get it to print the actual size. Anyone know what I am doinf wrong?

See my code below:

Shane


 if PrintDialog1.Execute then
 begin
  Printer.BeginDoc;
  Printer.Orientation:= poLandscape;
  Grid.PaintTo(Printer.Handle, 10, 10);
  Printer.EndDoc;
 end;
0
Comment
Question by:shaneholmes
6 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 7136968
instead of
Grid.PaintTo(Printer.Handle, 10, 10);

use
Grid.PaintTo(Printer.Canvas.Handle, 10, 10);
 
just a guess

meikl ;-)
0
 
LVL 5

Expert Comment

by:alanwhincup
ID: 7138372
What you would have to do is modify the printers canvas with the Windows API: SetMapMode, SetViewportExtEx, SetViewportOrgEx, SetWindowExtEx, SetWindowOrgEx. Alternately you could PaintTo a bitmap first and then print that.

Cheers,

Alan
0
 

Expert Comment

by:CleanupPing
ID: 9343096
shaneholmes:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 9460267
shaneholmes,
No comment has been added lately (18 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to alanwhincup http:#7138372

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

anAKiN
EE Cleanup Volunteer
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9460316
i do not agree
0
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 9460740
i agree with you kretzschmar,
i used to use functions recommended by alanwhincup to print a grid, but now saw that it was other thread to do so, however, doing the same with some extension.
at first thought your answer is too general.

of course your right was to post an objection and thank you for that.
the recommendation will be changed of course.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question