Solved

MS Datagrid printing

Posted on 2000-04-06
6
331 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 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Change owner from userA to server Local Administrators 7 51
move a line in eclipse 3 60
java ^ examples 8 57
Problem to event 3 50
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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now