Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MS Datagrid printing

Posted on 2000-04-06
6
Medium Priority
?
352 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
  • 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 1200 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

916 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