Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Funky Preview Window
Message
From
22/11/2008 16:11:31
 
 
To
22/11/2008 04:32:09
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01362540
Message ID:
01363675
Views:
16
>>Cathy Pountney wrote:
>>The parameters in the Render method use 960 dpi .. not FRUs.
>
>Thanks, yes, I know that. Typing fingers disconnected from brain -- the older I get, the more frequent that gets!
>I'm going to comb through my positional-adjustment terms -- again -- to see if I neglected to convert one correctly.

>>Doug Hennig wrote:
>>In addition to the other suggestions, I've also seen compressed pages when an object is positioned or sized
>>such that it's past the left or right edges of the page.

===============

I did find a couple of conversions to FRUs, instead of 960dpi -- which, of course, shoved report
objects well beyond the page. Straightened all that out, and there's no more preview page distortion. But, the
other problem I mentioned persists. Let me give a fuller description in hopes that something will ring a bell.

My listener is for a straightforward columnar report that allows users to specify which columns to list. My test report has two report
objects for column headings, two detail report objects for two corresponding columns of data, and nothing else to render
on the report form. The listener's BeforeReport loads an array prop on the listener with the user-specified
field names and their headings, their calculated column widths, and their calculated (accumulated) left positions.
All calculations are (now) fine, and the computed positions and widths are well within the page.
The listener has nAdjustLeft, nAdjustWidth, nAdjustTop and nAdjustHeight props. (All are initialized zero,
and the latter two are not changed by this listener.)

The listener's Render method has calls to BeforeRender, then the actual Render --
ReportListener::Render(tnFRXRecno, This.nAdjustLeft + tnLeft,This.nAdjustTop + tnTop, ;
This.nAdjustWidth + tnWidth, This.nAdjustHeight + tnHeight, tnObjectContinuationType, tcContentsToBeRendered, tiGDIPlusImage)
and a NODEFAULT
-- followed by a call to AfterRender.

EvaluateContents looks up the field name or heading in the array (based on whether the ColumnPicker directive's
expression is "Heading" or "Column"), and gets the value of the field from
the data cursor's current record if it is a column-data report object. BeforeRender sets nAdjustLeft and nAdjustWidth so that the
actual Render's computed param values are equal to the previously computed values in the array prop. AfterRender resets nAdjustLeft
and nAdjustWidth to zero. I have only one record in the report-data cursor and no other listeners.

When I specify only one column of output, the column 1-heading report object's EvaluateContents and
BeforeRender methods execute correctly, the object is rendered properly on the report preview page, and the AfterRender
fires. Then the same sequence runs correctly for the corresponding column 1-data report object. The column 2 report
objects (properly) do not appear. Ah, joy!

However, when I specify TWO columns, the EvaluateContents for the first column's heading and data-item report
objects fire as expected, but the BeforeRender does not fire for either object! The EvaluateContents and BeforeRender methods
fire for the second column's heading and data-item report objects as expected. All four objects render the proper values on the
page (so column 1 heading and column-data report objects are obviously firing a Render from somewhere -- presumably the
listener's parent class), but none of the four report objects is rendered in the proper Left position. All have been moved to the right to varying degrees -- as if the nAdjustLeft prop was not being reset properly (but, of course, that wackiness may well be entirely explained by the apparent
failure of the proper Render method to fire for the column 1 report objects).

Two questions: (1) When repositioning report field objects on the fly, Is there something more I should be doing,
other than setting the Left adjustment in the BeforeRender and re-zeroing it in the AfterRender? (2) Do the above symptoms
suggest anything obvious (or less obvious) to you that I should check out?

(P.S. I have not yet tried substituting a custom DrawString render....)

TIA,
-mark
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform