English 中文(简体)
How do I get FoxPro to snap-to-grid on an English report layed out in Metric?
原标题:

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.

最佳回答

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

问题回答

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





相关问题
A report writer for non-programmers?

we are wanting for users to be able to write their own reports in our application. It is a web application. We don t care if they must download an application in order to create reports, but we need ...

user report generation by various attributes

User table contains the following attributes (dateOfBirth, race, gender, ...). We would like to generate a report in the following format. Year Race All Male Female 2000 Asian 2000 1000 1000 ...

easy way to write report on data

looking for a good easy way to generate reports on data my application holds. rather than building it painfully by writing it all out and formatting it with /n s etc is there an easier method? It ...

Is there a .Net Reporting tool that uses Office templates?

On the application I am currently working on, we need a way for users to generate reports in Microsoft Word or Excel format (export and print). One of the requirement is that the users would create ...

Open Source & Free Adhoc / End User Reporting Tool [closed]

I am looking for an Open Source & Free Browser based Adhoc / End User Reporting Tool preferably based on Java (any other technologies are also welcome). I have researched on JasperServer Pro, ...

JUnit Result Aggregation

I m familiar with aggregating junit test results within a single build, but are there any tools that let you aggregate results across different builds? I d like to discover which tests failed most ...

热门标签