Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can this VFP report problem be solved with version 9.0?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00920703
Message ID:
00921833
Vues:
46
This message has been marked as the solution to the initial question of the thread.
OK, here's the scoop:

1) both the workarounds I had in mind worked -- both involved using a shape as a spacer object, and both were more code than I expected and had some conditions attached <s>.

One approach used a Shape and an Image, both small, using the Shape and the ReportListener.AdjustObjectSize event to make the band bigger IF NOT EMPTY(david.pic). Note that you can only use AdjustObjectSize to *increase* a Shape's size, not decrease, that's why the NOT in the evaluation.

The other approach used only a Shape and custom- rendered the file into the space where the shape was, in the ReportListener.Render method. You don't need an Image because you're doing the drawing for this object, using the graphics handle you get in the Render method.

So, okay. Some code.

2) The good news is: in the release product you probably won't need to use either of those approaches <g>.

ReportListener.AdjustObjectSize Event will be adjusted to work with Images as well as Shapes.

The basic approach will be the same; you'll set up your layout with an Image element that is only a couple of pixels tall, and make it taller when you actually have an image to display.

Also, if I remember correctly, your original report layout didn't have all the text objects set to "float and stretch". You'll need to do that for all objects underneath an object (whether shape or image) that you adjust in AdjustObjectSize, so that the adjusted element pushes them down properly.

The code you'll need to write will look something like this:
DEFINE CLASS rl AS ReportListener

   PicHeight = 960 * 3.75 &&  DPIs to the inch
   
   * These figures represent the desired space
   * for the picture in the layout 
   * when the picture exists
   * I probably do not have the measurements
   * exactly right, and this would be partly
   * dependent on whether you use Clip or Scale
  

   PROCEDURE AdjustObjectSize(nFrxRecno,oProps)
       SET DATASESSION TO (THIS.CurrentDataSession)
       IF (NOT EMPTY(David.pic))
          oProps.Height = THIS.PicHeight
          oProps.Reload = .T.
       ENDIF
   ENDPROC
   

ENDDEFINE
HTH, and thank you for the interesting question,

>L<
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform