Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ReportTip: PictureTemplates, CalcFields, GDI+, and You
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Titre:
ReportTip: PictureTemplates, CalcFields, GDI+, and You
Divers
Thread ID:
00919934
Message ID:
00919934
Vues:
91
[folks: I thought I posted this earlier today or last night. It doesn't appear to be here. I'm trying again. Apologies if this is a repeat.]

1. Let me first clarify something that was misleading in the Reporting Release Notes:

**Picture templates have always been used to determine how much will fit in a report expression (except for calculated field expressions, see below).**

What's changed is that you're noticing this fact now! That's because the amount of characters that can fit in the same space (with the same template) has changed slightly with GDI+.

Once again: If there is a picture template associated with a field control in your FRX layout, the report engine (old *or* new) has always looked at the template, rather than the actual value of a numeric expression, when deciding whether or not to show your expression or asterisks. It's just getting a slightly different result from this evaluation now.

Try the following experiment. It is subject to your default font and size, but these steps should be approximately correct in any font and size:

* create an expression in a report layout (in VFP 7 or 8) about an inch wide.

* use the value 5, or some other single digit as a literal, for the value of this expression.

* use the picture template 999,999,999.99 for this layout control.

* preview the report (you can use any table you like).

You will find that you see asterisks instead of the value 5.

For your exact layout control width and font, you may have to experiment with exactly the right template to "fit". For me, let's say it's 99,999,999.99 that shows the 5.

OK so far?

Now move to VFP 9 and SET REPORTB 80. If you preview the report, the 5 still shows.

However, if you SET REPORTB 90, it will not show (you will see asterisks again).

In your build, you may have to remove another couple of 9's to see the 5. In the release build, the algorithm will have been tuned, and (regardless of the font or size) the difference should only be one place, one 9. So, in the above example, 9,999,999.99 would work in new-style.

The difference is a small amount of difference in the kerning, padding, and display between GDI (used by the old engine) and GDI+ (used by the new engine).

GDI+ simply takes a little more space to display the same information.

So... if you had a slightly-sloppily designated picture template in VFP 7 and 8, overly generous with more 9's than your data needed, you might not have noticed this earlier. And now the field is slightly too small.

If you really need all those 9's in your template (because your data values can really be that big), then yes you will have to adjust the field size slightly for the values to fit in GDI+. This only makes sense, you want your data to show correctly and it doesn't do for numeric values to simply be truncated without warning. (That's why we got the asterisks in the first place. In VFP 9, for non-numeric data, you may also want to investigate your various string trimming options to give users additional clues about what's going on with your data values when the field does not stretch and your data does not fit.)

In my tests the difference is about one-twentieth of an inch; probably this varies with different fonts and sizes, but it's not a lot.

If your data values are really not as large as your template implies to the report engine, remove one 9 from your over-generous template and you should be okay. (Reminder: you might have to remove more than one in your build, this code has been changed. But there will always be a difference, probably of one place, in the template that will fit.)

2. Why the Report Wizard shows asterisks when you generate a report:

The Wizard includes picture templates in its expressions. Neither these templates nor the size of the fields the Wizard puts into report layouts have been tuned for new-style output.

3. Why calculated fields (whether generated by the Wizard or otherwise) don't show the same behavior:

**This turns out to be a bug.** Not in VFP 9, but in all versions -- and completely unrelated to the currency or other datatype related issues I thought might be involved earlier.

Here's the bug: The report engine doesn't pay any attention to the width of the report layout control when you choose to calculate the expression. It will render your results regardless of that rectangle. You would *never* see asterisks, IOW, regardless of size of rect, picture template, or value of expression. The calculation "does this fit in the rect?" simply is not done.

What's going to happen to this bug:

I have no final answer on this as yet.

Meanwhile, I hope this helps,

>L<
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform