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