I have a question
I have a following procedure in my APP that reads picture from BMP file and then inserts it into report builder Variable (sPKKPilt) who is Object type.
it works fine in 3.1(shows the picture in the report) but in 5.1 it somehow seems like don't convert string into picture again. Ive tried to read the file with the SAL functions and Vis functions.
Is there changes to SalReportSetObjectVar with the use of unicode or is there change how RB works on the Variable
Code: Select all
!!CB!! 134
Function: AbfPicToReport
Description: Accept a filename, report window handle and
report object variable name and set that report object variable to the
picture (a BMP) in the filename file.
Returns
Boolean:
Parameters
Window Handle: hWndRep
String: sFileName
String: sVariableName
Static Variables
Local variables
Long String: sPicture
Number: nPicLength
File Handle: fhPictureFile
Boolean: bRet
Number: nAbi
Actions
!
! This function opens the file with the desired picture
and reads the picture into a string, then passes that
to the passed report variable.
!
If VisFileOpen( fhPictureFile, sFileName, OF_Read ) = VTERR_Ok
Call SalStrSetBufferLength( sPicture, 65530 )
Set nPicLength= VisFileRead( fhPictureFile, sPicture, 50000 )
Call VisFileClose( fhPictureFile )
! Call SalFileOpen(fhPictureFile, sFileName, OF_Read)
! Set nPicLength = SalFileRead(fhPictureFile, sPicture, 50000)
! Call SalFileClose(fhPictureFile)
!
Set bRet = SalReportSetObjectVar( hWndRep, sVariableName, sPicture)
Return bRet