Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

The Visual FoxPro 9 Report Writer : Page 4

Microsoft has significantly improved the Report Writer in Visual FoxPro 9, while maintaining compatibility with previous versions of Visual FoxPro Reports, making the new Report Writer a great blend of the old and the new.


advertisement
Layout Object Enhancements
A few improvements have been added for layout objects, including an option to control template characters, a trim mode for character expressions, and relative and absolute positioning. Template Characters
The Field Properties dialog box has a new section for Template characters. The two available options are Overlay and Interleave. These determine how special characters are used in the format.

When the Overlay option is used, special characters are treated as part of the data and overlay any other specific character in a specified position. For example, when the Format expression is "999-999", and the data contains "123456", the report shows "123-56". Notice that the "4" is replaced by the dash in the format expression. When the Interleave option is used, the special character is inserted in between existing characters in the data. For example, when the Format expression is "999-999", and the data contains "123456", the report shows "123-456". Notice that the dash is inserted between the "3" and the "4".

Trim Mode for Character Expressions
Prior to Visual FoxPro 9, field objects were always trimmed to the nearest word when the text was too long. In Visual FoxPro 9, a new option on the Field Properties dialog box allows you to determine how the text is trimmed. The six trim options are:

  • Default trimming uses the default behavior, which is the same as the "Trim to nearest word, append ellipsis" option. This behavior is similar to prior versions of Visual FoxPro, with the exception of appending the ellipsis.
  • Trim to nearest character trims text to the last full character that fits in the defined area.
  • Trim to nearest word trims text to the last full word that fits in the defined area.
  • Trim to nearest character, append ellipsis trims text to the last full character that fits in the defined area, after an ellipsis is added to the text that prints.
  • Filespec: Show inner path as ellipsis replaces the inner directories of a long path and filename with an ellipsis when the full text does not fit in the defined area.
Size and Position
Another new feature available on Layout objects is better control of the size and position of the object. When an object is added to the report, the values for From page top, From left, Height, and Width are automatically set. It's important to note that the From page top property is relative to the top of the page in the Report Designer, which means it takes into account the height of any gray bars above the object. Changing the From page top property may inadvertently move the object to another band.


Relative Positioning: The From page top property and the Height property work together to determine whether absolute positioning or relative positioning is used. When the From page top property is set to a value that falls within the Report Designer surface, and the value of the Height property is less than or equal to the height of the band in which the object is located, relative positioning is used. Relative positioning is needed for objects in bands other than the Page Header and Page Footer. Absolute Positioning: When the From page top property is set to a value that falls outside the Report Designer surface, or the value of the Height property is greater than the height of the band in which the object is located, absolute positioning is used. Absolute positioning means the object is printed in exactly the same location on each and every page.

Absolute Positioning can be used to create a watermark on a report. Place a graphic image in the Page Header band, and set it to "Scale contents, retain shape." Change the From page top property and the From left property to indicate the upper-left corner of where you want the watermark to begin. Change the Height and Width properties to indicate the overall size of the watermark, making sure not to extend beyond the printable margins of the printer.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date