Thanks Cathy - that gets me a lot closer to understanding how this works but I'm still in murky water.
I have a copy of the report listener foundation class on a form where I intend to modify the action in the render method. I have a button on the form to run the report. I'm stuck on how to tell the report to use my version of the listener. TIA - Joe Yoder On Wednesday, February 25, 2009 8:17 AM, Cathy Pountney wrote: > >Date: Wed, 25 Feb 2009 08:17:29 -0500 >From: Cathy Pountney >To: [email protected] >cc: >Subject: RE: Centering a picture on a report > >1. When using a report listener, the FRX is open in a different datasession >(ID stored in ReportListener.FRXDataSession). In addition, several methods >in the report listener have nFRXRecno as a parameter which is the record >number in the FRX. So any time you want to access properties of an object, >do something like this: > >SET DATASESSION TO FRXDataSession >GOTO nFRXRecNo >** Look at whatever fields you want >SET DATASESSION TO CurrentDataSession > > >2. To get the properties of a picture ... > >*-- Create an image object >This.AddProperty('oImage', ; > NEWOBJECT('gpImage', HOME() + 'FFC\_GDIPLUS')) > >*-- Create the image >This.oImage.CreateFromFile("FileNameHere") > >*-- Get the picture width and height >lnActPictWidth = This.oImage.ImageWidth >lnActPictHeight = This.oImage.ImageHeight > > >3. To adjust the left position, you can use the Render method. One of the >parameters it passes is the Left. Issue a NODEFAULT .. and then >DODEFAULT(..parameter list) .. but substitute whatever you want for the left >property when you use the DODEFAULT. > > >I hope this helps, >Cathy > > > >> -----Original Message----- >> From: [email protected] [mailto:[email protected]] >On >> Behalf Of Joe Yoder >> Sent: Wednesday, February 25, 2009 1:26 AM >> To: [email protected] >> Subject: Centering a picture on a report >> >> I'm working on a report with a photo at the top of each page. The photo >> files are all .jpgs but some are landscape and some are portrait >> orientation. I need to hold the original aspect ratio of the photo to >> avoid distortion (Scale contents but Retain shape.) The picture box on >the >> report is in landscape orientation. When a photo with portrait >orientation >> is rendered it is positioned to have its left edge line up with the left >> edge of the picture box on the report. I want to change the left bound of >> the picture box on the fly based on the aspect ratio of the picture being >> printed to cause the picture to be centered above its caption. >> >> I understand it is possible to do this sort of thing with report listeners >> but haven't figured out how to access the properties of the objects on the >> report. Another thing I will need is a way to find the width and height >of >> the photo. I assume this is probably available via an API but maybe VFP >> has functions to do it as well. >> >> Thanks in advance for any help! >> >> Joe Yoder >> >> >> --- StripMime Report -- processed MIME parts --- >> multipart/alternative >> text/plain (text body -- kept) >> text/html >> --- >> [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

