Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ReportTip: Picture Templates, Numeric/Calc Exprs and You
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Product Documentation
Title:
ReportTip: Picture Templates, Numeric/Calc Exprs and You
Miscellaneous
Thread ID:
00919696
Message ID:
00919696
Views:
66
1. First, to clarify something that was definitely unclear in the release notes:

Picture templates *always* were used to determine "what will fit" in a report expression -- see below about an exception for calculated fields.

Try this in 7 and 8 and you'll see:

* create a report expression with a literal number in it, say 5

* make it an inch wide

* use the picture template 9,999,999,999.99

* preview -- you'll get asterisks.

The issue you're facing in VFP 9 with new-style output is that if you have sloppily-characterized picture templates in old report expressions, you will definitely notice the sloppiness now. When you add the slight difference GDI+ makes in expression width, these templates might not fit any more even if they did before.

In the above example :

Suppose I change the picture template to 99,999,999.99. This will fit if I SET REPORTBEHAVIOR 80.

However, if I SET REPORTBEHAVIOR 90, it will not fit.

I need to change to 9,999,999.99, since GDI+ renders this template with a little more width than GDI did.

Note: in your build, 9,999,999.99 may not fit -- the algorithm figuring out "what will fit" for new-style output has been improved since then. But VFP always has used the picture template at the beginning of a report run to determine "what will fit".

Also note, this example is probably font-dependent in exact numbers of "how many 9's", but the general idea is correct. In the re-tuned algorithm, there should only be one place-worth of difference in the picture templates that will fit.

If your picture template is not sloppily-characterized (IOW, if your output can really have that many places), you will need to change the width of your expression very slightly so that GDI+ can handle that output. This only makes sense. If your numbers are that large, make room for them.

If your template is too large for your real output, change the number of 9's in your template. In the release product, you should only have to remove one digit.

2. Why do you see asterisks when you simply generate reports from the Wizard?

The Wizard includes picture templates in its report expressions. The Wizard hasn't yet been adjusted, either in its picture templates or the sizes of the field expressions it creates, for the additional size required by GDI+.

3. Why are calculated fields (whether from the Wizard or in your reports) different in this respect?

Well, this is a bug . Not in VFP 9, but in all versions of VFP. And, as it turns out, the bug is totally unrelated to the picture clause.

Here's why you do not see asterisks in calculated fields:

When you use a calculated field, VFP is entirely ignoring the rectangle (the size of the field control) that you put in the layout. IOW, if the expression runs over the field size, it is still rendered to its full width. You'll never get asterisks.

The calculated size of "what will fit" for the field control you put on the layout, whether that calculation is done based on a picture template or the width of the rectangle, is simply never used.

What is going to happen to this in VFP 9? Not sure at the moment <g>.

HTH, anyway,

>L<
Reply
Map
View

Click here to load this message in the networking platform