Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report layout differs when running 1

SitesMasstec

Programmer
Sep 26, 2010
558
Brasil
Hello colleagues!

I have been wasting more time to fine ajust the position of objects when design a report than creating the report itself.

DesignRunReport.jpg

Is it a fault in VFP 9?

I have tried even (instead of moving labels through the report using arrows) to set the position "From left" (for example 5,614 in) for all the 4 labels above (Emissão, Navio, Localizador, Vendedor) but VFP doesn't obey!

The report is set to: SET REPORTBEHAVIOR 90

Is there any other way to achieve fine ajustment for the objects?

Thank you.
 
The only thing that comes to mind is the alignment properties.

Positions that are set at design time normally default to left, so the left position is fixed at the place you created them. However items that align right or center may vary a little bit at runtime to reflect the selected printer and font.
 
Yes, Joe, I tried "From left" property, too:
DesignReport.jpg

VFP doesn't keep the exact measure when running the report.
 
as shown in my picture i create a vertical line as ruler over the whole page. so i can easy adjust the left or right position of those fields.
the field.top position i set 0.01 mm less then teh corresponding label in front. so the text has almost same position in the horizontal view.
Frm_467.jpg.

in newer reports i do not use labels anymore. i do create a field with the content "LabelName" and next to it a field with my data
Frm_468.jpg Text for the Label
Frm_469.jpg Expression to display

in this case the label and data will be in the same height
 
Last edited:
Can you display the result of this query, please?

Code:
Select Cast(Expr as varchar(50)) as caption, hpos, vpos , Cast(fontface as varchar(50)) as font, fontsize, float, stretch From yourreport.frx Where ObjType=5
 
It's not bug of VFP, but behavior at using GDI+ for rendering text with Gdiplus::StringFormat::GenericDefault .
 
Hi,

You may want to have a look at Format - Snap to Grid (I have it checked) and Format - Set Grid Scale (I have it at 6 pixels) in the Report designer.

hth

MarK
 
Fine, SitesMasstec.

The HPOS values are the "from left" position. I don't see them matching for Emissao and Navio, for example.
So you haven't alligned these labels in the designer. Simple truth, simple effect. Of course you don't get aligned output, it's not even aligned in the design.
 
Mark:

I have also it checked to Snap to Grid.

Set Grid Scale (to 6 pixels) doesn't wotk either: it just has effect to show the report on screen, it doesn't fine tune the position when moving a label using arrows.
For example, a label is 4.968 inches from left, the next position if I type right arrow on the label, the label goes to 4.979 inches from left, even using Grid Scale to 6 pixels.
 
Ein, yes, I tried it, also.

I concluded that it cannot be fine ajusted: in the VFP book "What's New in Nine", page 100, it explains about "Absolut positioning": it cannot be perfect, as I have understood.

I used a green vertical line, as a ruler, as you advised in your earlier post. It helps.

Thank you.
 
it doesn't fine tune the position when moving a label using arrows
The snap to grid function only works whn using the mouse to position objects, just like it works in the form designer.

I concluded that it cannot be fine ajusted: in the VFP book "What's New in Nine", page 100, it explains about "Absolut positioning": it cannot be perfect, as I have understood.
That's not true. All left sides of bands are the same offset from the left page margin: The margin width you set, so put in the same "from left" number and the labels left alignment will be the same. Your FRX data shows they are not the same numbers, you think you've set them the same, but even the screenshot you posted shows your labels are not aligned, that can eyeballed. The numbers just caught you pants down, you thought you have set all positions the same, but you didn't
 
Just to showcase what is possible:

1. The Report Designer screenshot:
1742931521359.png
2.The Report Preview Screenshot
1742931577672.png
3. PDF Output viewed at 400% zoom:
1742933189894.png

I don't see any problem. Do you?
 
Chriss: I am happy to be wrong and VFP (in REPORTBEHAVIOUR 90) does that fine positioning.

I will try again and I'll post my result here.

Thank you.
 
This was done without specifing the "from left" value but using the snap-to-grid functionality. For finer granularity in smaller steps I reduced the grid spacing, that's up to you, of course. You also have several other tools others also mentioned already, like the layout toolbar.

You can finally verify you have the exact same "from left" value by doing the query I gave you above looking into HPos of the labels you want to have the same left margin/offset/position.
 
I would suggest making a copy of your report first. Then hack the report by opening via USE reportname.frx. Then manually set the hpos value to the same value for the objects that you want to be all aligned.
 

Part and Inventory Search

Sponsor

Back
Top