Solved

MS Datagrid printing

Posted on 2000-04-06
6
347 Views
Last Modified: 2013-11-20
Hi experts,

I have a VC++ app with a MS datagrid 6.0 control.

How can I print the contents of the grid easily?

Please insert code samples. (And don't tell me to look at codeguru)


Thanks in advance!
0
Comment
Question by:MelissaC
[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
  • 3
  • 3
6 Comments
 
LVL 2

Author Comment

by:MelissaC
ID: 2699948
Adjusted points from 50 to 300
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 300 total points
ID: 2824024
Hi,
I can't find an easy way.  I need to implement that same function in one of my projects, but it's low priority right now.

I found this:

http://support.microsoft.com/support/kb/articles/Q96/9/41.asp

....which is basically "check each cell and print its text" and it uses the VB Print object, anyway.  This in not a bad way to go -- and it's probably what I'll end up with because I don't need a lot of flexibiliyt (colors, fonts, pagination, etc) -- since you have total control, but it's not a canned answer by any means.

Another method is shown at:

http://www.deja.com/usenet/

if you search for

MSFlexGrid and print

That one uses the idea of resizing the control so all its cells are "visible" then asking the control to paint itself, passing it your own HDC.  You can scale the result and print it.

* How big is your grid?

* Is it a dlgbox control or are you putting it in a View?

* If Ms Word or Excel is known to be available (ie, corporate setting), you could explore the idea of passing the data into one of these objects, since they both support IPrint.

-- dan










http://x44.deja.com/getdoc.xp?AN=621241931&CONTEXT=958695773.773062669&hitnum=16


0
 
LVL 49

Expert Comment

by:DanRollins
ID: 2886188
Melissa,
r u there?
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 2

Author Comment

by:MelissaC
ID: 3221470
Hi Dan,

Sorry to keep you waiting. I was on a holiday, isn't that terrible!
Anyway, I think I'll use Excel automation and let Excel do the dirty work for me. The HDC-stuff also looks nice, but I think my grid contains to much data to do that. I'll keep it in mind for future projects though.
Anyway, which solution will you be using for your project?

Thanks very much,
Melissa
0
 
LVL 2

Author Comment

by:MelissaC
ID: 3221490
Comment accepted as answer
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 3290850
Thanks!
I've settled on the simple "examine and print each cell" .  I just use a fixed-width font and use spacing to line up the cells.  Simple is often best.

-- dan
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

734 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