You are here:

FoxPro/Report display edit

Advertisement


Question
QUESTION: In VFP 6.0, I have an old report that I need to change labels and headings on the actual printed page. I don't need to modify any of the target or important data. I tried opening the report and manually editing it already. It saves correctly and re-opens with the changes that I made intact, but when the program physically prints the page, it prints with the old words/format still.
For instance:
The old heading was "State Management" and I double clicked it, typed in "US Management" and saved and closed on the report.
Upon printing, it still says "State Management" at the top, like I never changed anything.
What am I not doing correctly to make the changes? Thanks!

Oh, I checked the code and in theory it is targeting the correct report that I have manually edited to print. I hope that all makes sense.

ANSWER: Corey,

Since the change is being made (as proven by re-opening the report and seeing the
change is there), the problem seems to be in the execution.  I can offer some
suggestions, but without having access to the code, I can't provide a sure fix.  

1.  If the program is compiled to an APP or an EXE, be sure to recompile after
   making changes to the report.

2.  If you are running the program interactively (from the Command Window):
   [ Your changes may not be forcing the old version out of memory.]

   a.  Execute CLEAR PROGRAM and CLEAR MEMORY after the changes, OR
   b.  Quit VFP and restart before running the changed version.     

   [ If "a." doesn't work, try "b." before giving up on this idea.]

3.  When you run MODIFY REPORT, try deleting the text and adding a new label.
   This will ensure you have not unintentionally added a text field instead of
   changing it.  When you delete the new wording ("US Management") you may see
   "State Management" is still there.  If this is the case, the label that is
   logically "on top" will be the one that prints.  
   You can also check for an underlying label by moving the "US Management" up
   or down to see if there is something under it.

If none of the above suggestions help, open the controlling program with MODIFY
COMMAND, capture the screen, save the image as a JPG and attach the image file
to a follow-up question.  If you can send more than one picture, do the same with
the report form using MODIFY REPORT.

Good Luck,

Fred



---------- FOLLOW-UP ----------

command code
command code  
Click Code
Click Code  
QUESTION: I tried recompiling, clearing program/memory, restarting, and I'd already tried #3 (I still triple checked it after your reply). All to no avail. I've attached two screen shots. One is of the code that the program points to when a user clicks the Save/Print button (Command1). The other is from the Modify Command code screen. If you need more to look at or have any other suggestions, feel free to help more. I really thought that #2 suggestion was going to be the culprit but it didn't change a thing :-/  
Also, Sorry for the delayed reply. It got back burner'ed for a couple of days. I will post a follow up each time, success or fail.
Thanks again!

ANSWER: Corey,

  I don't see anything in the image files that helps.  I have only two more suggestions.

  1.  Use MODIFY PROJECT to open your project file.  Use the "Build" button to create
       the EXE file.  From the Build dialog box, check the box to "Recompile all files."
       If you have not been using a project file, try the next suggestion first (it will
       be easier).  If #2 fails to help (which would amaze me), or if you just want to
       make it easier to work with your program, create a project with MODI PROJ <ProjName>
       Then add the start-up program to the project and use "Build" process as above.

  2.  MODIFY the report again, confirm the changes are intact, then use "File" - "Save As"
       and give the report a different name, change your code to use the new name.  Then
       re-compile to create your EXE.

  I am confident than either of these will work, but, if neither of the above two
suggestions correct the printed page, let me know and, if you're willing, we'll try a more
direct approach.

Good Luck,

Fred

---------- FOLLOW-UP ----------

Temp Files
Temp Files  
QUESTION: Finally, with your guidance, I got it to work! The underlying problem was that the RSView project was pointing at a certain *.exe and the project I was working on wasn't updating that .exe file when compiling. So I tried number 2 first, which of course didn't work, then just happened to catch a flash of where the RSView was pointing which made me scratch my head and look more thoroughly. I did need to do #1 to get it to work and create a new .exe file, so thank you very much! My OCD was really starting to get to me for this situation.

I have two last, hopefully quick and easy, questions:

I attached a screenshot to this of the file folder where this program is kept. There are quite a few *.tmp files, all created on one day (10/6) and all 0kb. What would have caused them and can I delete them? I dislike useless clutter, especially on an old computer that needs to stay as streamlined as possible.

Thank you for all of your help!

Answer
Corey

  The .TMP files are temporary files created by VFP when doing various tasks.  They can be
deleted without creating any problems - as long as the VFP program is not currently running.
FoxPro will generally get rid of its temporary files when it's done with them or when the
program quits.  If they are being left behind, it usually means the program was improperly
terminated.  For example, an error occurred and the program was terminated with the "Cancel"
button from the error dialog box.  Since they are all 0KB, they are nothing more than entries
in the File Allocation Table for that drive.  They are not wasting any space or causing any
slowdown on your computer, with the possible exception of doing file searches.

  I am glad your original problem was solved.  If I can be of future assistance, feel free
to post new questions at any time.

Best of Luck,

Fred  

FoxPro

All Answers


Answers by Expert:


Ask Experts

Volunteer


Fred Frase

Expertise

Questions about development only. No installation or hardware specific questions, please. Your first step in requesting assistance should be to identify the version of FoxPro you are using. I can write short functions but, PLEASE do not ask me to write programs for you.

Experience

Nearly 30 years professional programming experience using FoxPro (FoxBase through VFP 9) or other xbase language, primarily in Windows environments.

Education/Credentials
Completed a 1,000 hour diploma course in programming at International Academy of Ohio (subsequently merged with Southern Ohio College).

©2016 About.com. All rights reserved.