Solved

Printing TDrawGrid

Posted on 2002-07-07
6
279 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Multiple image collision 13 87
MS Access from Delphi 31 78
DBCtrlGrid, Delphi, Scroll 8 55
migrate this code to work on android 1 27
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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 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