How to Print Pictures in a Report by Using an Embedded PathID: Q139624
WINDOWS | MACINTOSH
kbtool kbole kbhowto
The information in this article applies to:
SUMMARYThere may be times when you don't want to embed pictures in general fields in a table. This article shows by example how to store the location of the picture file in a field in a table. The field holds the absolute path name that points to where the picture file can be found. The technique in this article is especially useful for situations where your pictures are updated on a regular basis but continue to use the same file name. By using this technique, you can avoid having to update embedded pictures in a table. As a result, your tables are physically smaller, you always have the most current picture available to your application, and you continue to achieve the same functionality as you would with an embedded picture. Although using an embedded path reference in place of an absolute file reference is not documented, you can achieve this functionality by using the Report Writer as documented in this article.
MORE INFORMATIONUsing the Visual FoxPro Report Writer, you can place general fields that contain pictures into your report, or you can place the pictures themselves into your report. Depending on your requirements, it may be more efficient and easier to point FoxPro to the location of the picture file instead of embedding the data in a general field. When an OLE container is placed in a report, you are given two choices. You can insert a picture from either a file or a field. When you point Visual FoxPro to a file, the file contents are physically displayed in the report both while you are designing it and at run time as well. The other option is to point to a general field in a table, which will display the picture data only when the report is run. The third, undocumented way to display pictures in a report is to put a reference to a field which contains absolute path and file information in the 'Picture from file' radio button field contents. The following steps demonstrate how to achieve this result. To make this work, you must have the FOX.BMP file in the location specified in the INSERT INTO statement. If your location is different, modify the statement accordingly. 1. Type each of the following commands in the Command window:
2. Add the Picttest table to the report's data environment by right-
3. In the Add Table or View dialog box, click Other and select the Picttest
4. In the Report Designer, place a field control in the Detail band on the
5. Add a Picture/OLE Bound Control field to the report in the Detail band.
6. Run the report. You should see a single record displayed along with
Additional reference words: VFoxMac 3.00b 3.00 VFoxWin
KBCategory: kbtool kbole kbhowto
KBSubcategory: FxtoolRwriter
|
Last Reviewed: June 2, 1996 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |