The Picture field contains file path information relative to the temporary file location when you use ReportBuilder hook methods in Visual FoxPro (914965)
The information in this article applies to:
- Microsoft Visual FoxPro 9.0 Professional Edition
SUMMARYIf you write Report Builder extensions or code to be run during Report Designer hook events, the image file information appears in the Picture field for image layout controls. However, the path information is relative to the Visual FoxPro temporary file location instead of relative to the .frx file or .lbx file that is being edited in the Report Designer.
SYMPTOMSWhen you use the ReportBuilder hook methods in Visual FoxPro 9.0 and later versions, the Visual FoxPro native Report Designer provides a read/write copy of the report or label definition table (that is, the FRX or LBX definition table). This copy should exactly match the data in the FRX table or the LBX table that is currently open in the Report Designer window. However, image file information in this copy is provided relative to a temporary file location, the Report Designer's buffer, instead of relative to the actual .frx file or .lbx file that is being edited.
When the Report Designer saves the relative path information at the end of a design session, the path is saved correctly. That is, the path is saved relative to the actual .frx file or .lbx file.RESOLUTIONTo resolve this problem, the Visual FoxPro code that reads the data from the FRX copy during a ReportBuilder event must extrapolate the full path of the file name by using the user's temporary file location instead of by using the true location of the .frx file or .lbx file. The user's temporary file location is provided in the SYS(2023) function. The following code shows how to extrapolate the path correctly: local cPicture, cFRXFileName
cFRXFileName = this.CommandClauses.File && actual location of FRX
cPicture = alltrim(FRX.PICTURE) && location of the image filename
cPicture = lower(fullpath(m.cPicture, addbs(sys(2023))))
* do not use:
* cPicture = lower(fullpath(m.cPicture, justpath(cFRXFileName) STATUS This behavior is by design.REFERENCES For more information, visit the following Microsoft Developer Network (MSDN) Web sites: REFERENCES
Modification Type: | Major | Last Reviewed: | 7/3/2006 |
---|
Keywords: | kbprb kbReportWriter KB914965 kbAudDeveloper |
---|
|