Solved

MS Datagrid printing

Posted on 2000-04-06
6
348 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
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.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

626 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