Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Formatting data for a report

Formatting data for a report

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bcemick
    wrote on last edited by
    #1

    (Using VSC++ 6 - MFC) I've looked through several articles (such as Printing with MFC Made Easy by Dan Pilat) and posts but, the information I'm looking for just isn't there. Plus, this is something that I want to do on my own, I just want to understand how it works; not have someone do it for me. I'm trying to get data from a list control straight to the printer and have it formatted correctly. So far, everything I've tried hasn't worked. I've tried setting up tabs, but the printer prints them out as little squares. I've tried to manually set where each piece of information should print out at (x and y coordinates), but it's not working either, especially if the size of the string being printed changes (it throws everything else off). Basically, here's what I want to set up and what I'm looking for some help with:

    Column #1 Column#2 Column #3 (and so on)
    Some data here Some more Right-aligned data

    Because this is pretty much how it's coming out (or some variation thereof):

    Column #1 Column#2 Column #3 (and so on)
    Some datSome moreRight-aligned data

    Any ideas on how I can get the information to format correctly? Any help is appreciated.

    RaviBeeR 1 Reply Last reply
    0
    • B bcemick

      (Using VSC++ 6 - MFC) I've looked through several articles (such as Printing with MFC Made Easy by Dan Pilat) and posts but, the information I'm looking for just isn't there. Plus, this is something that I want to do on my own, I just want to understand how it works; not have someone do it for me. I'm trying to get data from a list control straight to the printer and have it formatted correctly. So far, everything I've tried hasn't worked. I've tried setting up tabs, but the printer prints them out as little squares. I've tried to manually set where each piece of information should print out at (x and y coordinates), but it's not working either, especially if the size of the string being printed changes (it throws everything else off). Basically, here's what I want to set up and what I'm looking for some help with:

      Column #1 Column#2 Column #3 (and so on)
      Some data here Some more Right-aligned data

      Because this is pretty much how it's coming out (or some variation thereof):

      Column #1 Column#2 Column #3 (and so on)
      Some datSome moreRight-aligned data

      Any ideas on how I can get the information to format correctly? Any help is appreciated.

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      There are several articles here[^] that will likely provide useful information and perhaps even a canned class that you can use to achieve your goal. Btw, I cheat by writing my app's[^] contents to a temporary HTML file and printing that. Works beautifully with any paper size and both landscape/portrait modes! /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

      B 1 Reply Last reply
      0
      • RaviBeeR RaviBee

        There are several articles here[^] that will likely provide useful information and perhaps even a canned class that you can use to achieve your goal. Btw, I cheat by writing my app's[^] contents to a temporary HTML file and printing that. Works beautifully with any paper size and both landscape/portrait modes! /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

        B Offline
        B Offline
        bcemick
        wrote on last edited by
        #3

        Thanks for the links and tips. I have read through some of those articles that seemed to be the best ones for what I'm looking for. However, I haven't been able to find any that actually show how the data is formatted for the printed report (unless I missed it somewhere - always possible). I guess I'll just keep combing through them until I come across what I'm looking for or I figure it out for myself. Again, thank you.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups