How to change the Report Designer ruler measurement (186920)



The information in this article applies to:

  • Microsoft FoxPro for MS-DOS 2.5
  • Microsoft FoxPro for MS-DOS 2.5a
  • Microsoft FoxPro for MS-DOS 2.5b
  • Microsoft FoxPro for MS-DOS 2.6
  • Microsoft FoxPro for MS-DOS 2.6a
  • Microsoft FoxPro for Windows 2.5
  • Microsoft FoxPro for Windows 2.5a
  • Microsoft FoxPro for Windows 2.5b
  • Microsoft FoxPro for Windows 2.6
  • Microsoft FoxPro for Windows 2.6a
  • Microsoft FoxPro for Macintosh 2.5b
  • Microsoft FoxPro for Macintosh 2.5c
  • Microsoft FoxPro for Macintosh 2.6a
  • Microsoft Visual FoxPro for Macintosh 3.0b
  • Microsoft FoxPro for UNIX 2.6
  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 7.0
  • Microsoft Visual FoxPro 8.0
  • Microsoft Visual FoxPro 9.0 Professional Edition

This article was previously published under Q186920

SUMMARY

It may be necessary to change the measurement unit of the ruler in the Report Designer. For instance, the Report Form Wizard in Visual FoxPro for Windows defaults to inches even if Measurement System in the Regional Settings Properties is set to Metric. Applications that allow users to modify reports could use this functionality, allowing the user to choose between a Metric ruler and a U. S. ruler.

MORE INFORMATION

According to the 50frx1.frx report form in the HOME() + "FILESPEC" directory of Visual FoxPro 5.0 (Visual FoxPro 3.0x has the file 30frx1.frx, and Visual FoxPro 6.0 and later versions have the file 60frx1.frx), the Ruler field of a .frx report file "specifies 1 if the ruler is displayed". When the report is created, the value of the Ruler field could actually be one of three values. The list below shows the three values and the measurement system to which each value corresponds:

1 = U. S. (inches)
2 = Metric
3 = Pixels

The following sample code shows how to programmatically change the value of this field and consequentially change the ruler measurement.

Sample Code

   *-- Code begins here
   lsRptFile = GETFILE("FRX", "Report file to open:", "Open", 0)
   IF LEN(ALLTRIM(lsRptFile)) = 0
       RETURN
   ENDIF
   USE(lsRptFile)
   LOCATE FOR objtype = 1 && Find the record for the report form object.
   IF FOUND()
      REPLACE ruler WITH 2 && Use the metric ruler.
   ELSE
      MESSAGEBOX("Not a valid report file.", 0, "Error")
      USE
      RETURN
   ENDIF
   USE

   *-- View the report to see the changes.
   MODIFY REPORT (lsRptFile)
   *-- Code ends here
				
NOTE: In FoxPro 2.x for MS-DOS and Unix, the system menu disappears when you modify the report in the program. Once you close the Report Designer and the program exits, the system menu returns.

In Visaul FoxPro 9.0, you can change the report's measurement unit by choosing Properties from the Report menu pad and then clicking the Ruler/Grid tab.

REFERENCES


Modification Type:MajorLast Reviewed:2/2/2005
Keywords:kbhowto KB186920