use something other than .txt to present report

Greetings Programmers:

I have the task of developing a program that gathers users input (text and integers), makes calculations, and collates reports. The program is working well, but the presentation of the reports looks poor.

I generate the reports in .txt format; and although I positioned the columns and rows, the columns are ragged. I too late realized that names with "i" and "l" take up less room than names with "w" and "m" so that even the same number of characters do not take up the same space.

I am not allowed to use an external spreadsheet or database and the program must be "self sufficient" in presenting the reports. Would you use .txt here or is there another way to present the reports? My Visual C++ compiler comes with an active x grid control, but there is very little documentation and what info I find on the web for the control is in Visual Basic.

I would greatly appreciate a suggestion. I am not the equal of most of those on this site, but someday hope to learn enough to help others and appreciate any guidance you can give.
Last edited on
The extension of the file doesn't really matter. Without being able to use a spreadsheet or anything, you're pretty limited in what you can do.

You can look into monospace fonts, which will solve the issue of some characters taking up more or less space than others.

OR what you could do is write it into an HTML file. Just create a <table> and stick your data in there.
Thank you for your reply. I value the time and experience of those who know more than I. I'm going to check out how long it will take to get up to speed on .xml...and also check out the monspace fonts. I'm seeing more potential in HTML/xml. Thanks!
I like ResidentBisuit's suggestin to use HTML. That will give you a great deal of control over the appearance of the report. However, I'm not sure if that will meet your "self-sufficient" requirement since you would need a browser to read the HTML file.
Last edited on
Thank you AA. I think the HTML approach will be acceptable because everybody on the network has a browser. The Corporation just doesn't want to get into requiring a certain kind of spreadsheet or database on every workstation. Understandable.
HTML would work great for a read-only situation.

If you want users to be able to edit values, I would check out making a CSV ( comma separated value ). The format would look something like this:
1
2
3
name,age
john,29
henry,30


Any spreadsheet program worth anything is able to both import and export csvs. This would make it easy for someone without any programming skill to do something like get the average age of your list of people.

It's also easier to parse if you ever need to write a program to edit your file.
Last edited on
Topic archived. No new replies allowed.