Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Printing TDrawGrid

Posted on 2002-07-07
6
Medium Priority
?
285 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 200 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

810 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