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. Help in Generating Reports

Help in Generating Reports

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorial
4 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.
  • T Offline
    T Offline
    TheFox
    wrote on last edited by
    #1

    I have a Windows VC++ SDI Application that gathers and process data. All I want to do is generate a report from data I have collected!!!. I want to be able to generate a report when I select ‘Generate Report’. (And NOT File -> New) I also want to be able to Print the report. I have now idea how to do it. Please help me.

    G 1 Reply Last reply
    0
    • T TheFox

      I have a Windows VC++ SDI Application that gathers and process data. All I want to do is generate a report from data I have collected!!!. I want to be able to generate a report when I select ‘Generate Report’. (And NOT File -> New) I also want to be able to Print the report. I have now idea how to do it. Please help me.

      G Offline
      G Offline
      G Steudtel
      wrote on last edited by
      #2

      Hi, probaly the easiest approach is before saving your data, you transform the data into a CStringArray. That is for every data you need report you transform this data into a textual representation (CString) and add it to the array. Then you may store the array into a file. If you take care that a line is not too long, then you may also print that array line by line. Do a heighth calualtion and divide the paper length by this height to get the number of pages to print. Your application framework should alredy have the appropriate Print(Preview) functions installed. If you do NOT want to select File New, rename it. Regards G. Steudtel

      T 1 Reply Last reply
      0
      • G G Steudtel

        Hi, probaly the easiest approach is before saving your data, you transform the data into a CStringArray. That is for every data you need report you transform this data into a textual representation (CString) and add it to the array. Then you may store the array into a file. If you take care that a line is not too long, then you may also print that array line by line. Do a heighth calualtion and divide the paper length by this height to get the number of pages to print. Your application framework should alredy have the appropriate Print(Preview) functions installed. If you do NOT want to select File New, rename it. Regards G. Steudtel

        T Offline
        T Offline
        TheFox
        wrote on last edited by
        #3

        No it's worse that that, I don't understand how I can get the code to write text to the screen. I think you need to pretend that I don't understand VC++!!!

        G 1 Reply Last reply
        0
        • T TheFox

          No it's worse that that, I don't understand how I can get the code to write text to the screen. I think you need to pretend that I don't understand VC++!!!

          G Offline
          G Offline
          G Steudtel
          wrote on last edited by
          #4

          Hi, well, never mind in the last century I was in the same situation. But to tell in detail what you should do and not would be a lengthy excursion by space and by time. I have written an article "Documenting header files" and posted it here at codeproject [^]in the source code you will find a method to put some datas into strings and display and print them. The same method is also used to store the datas. If you download the source files have a look at the BeginPrinting OnPrint functions in the ViewHeaderDocumentor.cpp file. The other parts of interest are in DocHeaderDocumenter the OnSave... routines and the MakeOutput... routines. Those routines call other (helper)routines until a CStringArray is filled. I guess it will take a couple of hours until you get an idea of how it's working, but i will. Regards G. Steudtel

          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