views:

82

answers:

2

So I've recently had to create a report that emulates a Canadian customs form. The problem is that the report is printed on 11" x 14" paper, but uses a metric layout. As my FoxPro installation is on a machine with US-English units-of-measure, FoxPro tries to oblige by using an English ruler, and doing snap-to-grid on inch-based measurements. This creates some minor design issues obviously.

I understand that the reports are really just tables in disguise, and I have figured out how to turn on the Metric ruler (instead of the English one) by changing a record, and that is working as intended. However, the snap-to-grid functionality appears to want to snap on 48 units-to-an-inch, instead of something Metric. So moving a box around using a mouse results in the box being offset (again) in English measurements.

To get around this, I have taken to openning up the report as a table and manually converted all Metric units with a spreadsheet, and entered the offsets and sizes by hand. While this has worked well and appears to be very accurate, it's still error-prone.

So the question is, how do I get FoxPro 8 to snap-to-grid in Metric units on the report, so that I don't have to keep re-entering numbers by hand? It would be nice to get FoxPro to accomodate Metric in a fashion where I can align objects in the report using a mouse, rather than punching them in as numbers and "flipping" the report into design view to check it.

For reference, currently there are the following translations:

25.4 mm = 1 inch = 10,000 report units = 48 grid snap points

Obviously I'd like something closer to this:

25.4 mm = 1 inch = 10,000 report units = 25.4 grid snap points

Note: Yes, I have considered setting up a Virutal Machine with FoxPro that uses a Metric install, i.e. a Windows XP install set up for Canada. However, that will take another day or so to get the installation done, along with the rest of the development environment, so I'm trying to avoid that.

+2  A: 

Hidden unless you've been exposed to more of it...

Modify your report. Right-click, get to properties of the report. On the tab for Ruler / Grid, there is a combobox which is defaulted to ruler of "inches", but you can change it to Metric/cm or Pixels. Below that is your grid snap and you can change the default of how many pixels to snap to.

Additionally, if you use your cursor keys, you can move the controls one pixel at a time for more precise alignments as needed. And if you need to resize a control's width, if you hold the Ctrl key down and use the arrow keys left/right, will shrink / strecth one pixel at a time instead of moving the control. Likewise for the moving and sizing if you pick multiple controls, they will ALL move or resize respectively.

HTH

DRapp
That was very helpful, however, there is no "Property" option on the report designer.
Avery Payne
Aside from right-click in an open area of the report, it should also be at the top main menu of VFP under "Report", then "Properties...", but the report has to be the window of focus for the menu to appear as only applicable to reports. Then, you'll see a pageframe with many tabs associated with the reports... One such is labeled "Ruler/Grid" where you can change to metric, and change the basis in pixels to snap to as a default. If running another version, I'll see what I can find historically where it may be, but it SHOULD be there even in older versions (VFP8, 7, 6).
DRapp
Sorry, just checked, it's not present in either case. I'm running VFP 8. Options in the Report menu: Title/Summary, Data Grouping, Variables, Default Font, Bands, Ins. Control, Private Data Session, Printer Env., Run Report. The File menu has Page Setup and Print Preview. Page setup does show dimensions in inches, but displays that as text (no dropdown or combo box).
Avery Payne
I'll try to dig through my old MSDN for VFP8 and install on an old notebook and see what I can come up with... VFP9 has it directly available.
DRapp
+1  A: 

Hi Avery,

Just spoke with a freind lastnight who has VFP8 installed. Based on that version, there MIGHT be a way to get metric for your reports. There is a setting on the reports from showing based on PIXELS, or SYSTEM METRIC. If you system configuration is based on inches, so too is the report. If you change your system metric to that of centimeters (or whatever equivalent it would be), so too should the report respect in design time.

HTH

DRapp