
XmlDisplayListener, General Fields, and Image Controls
When processing images that did not come from a file on disk, XmlDisplayListener always provides a copy on disk for your use. By default, these files are placed in the same location as your generated report output file, but you can set this location to a different folder, using the XmlDisplayListener.externalFileLocation property. The folder you nominate for this use must exist; otherwise, XmlDisplayListener ignores the instruction.
Tip |
|---|
| When preparing to publish web documents, you will often want to set the location of the image files to a separate directory from the main output file. It is a good idea to set the location as a relative reference, such as ".\images." XmlDisplayListener understands these references to be relative to your main output file. |
XmlDisplayListener must save a separate image to disk every time the report renders an image. Because these images may be different for every record in your report, it uses a generated filename convention to name the files. You can adjust these filenames by adding a base filename, to which XmlDisplayListener adds its generated portion as a suffix. This distinguishes your image files from other files from different report runs.
By default, the base class ReportListener does not send full image information to its derived classes. You must request the appropriate information, using the ReportListener.SendGDIPlusImage property.
At the start of a report run, XmlDisplayListener checks to see if there are any General fields in your report design. If it finds references to General fields, it sets .SendGDIPlusImage temporarily, if necessary, and restores the value later.
In Visual FoxPro 9, report designs can include expressions that reference Image controls, as well as general fields and image files on disk. If the Report Engine finds an expression representing an Image control object associated with an Image layout control while it processes your report, it uses the image information in the Image control's PictureVal property. For more information, see PictureVal Property.
XmlDisplayListener cannot know that your report layout expressions may represent Image controls (rather than indirect references to image files on disk) when it evaluates your FRX. For this reason, if you use expressions representing Image controls, unless there are also General fields in your report, you must set its XmlDisplayListener.SendGDIPlusImage explicitly. This explicit instruction will cause the ReportListener to provide the necessary image information as it renders your report. With this property set, XmlDisplayListener detects the GDPlusImage handle the first time it receives one and, if it has not done so earlier, it will set the other, associated attributes required to save the files to disk.