error - retrieving picture from database and showing in the report builder

forum.advanced.programming (2000-2005)
Chellammal

error - retrieving picture from database and showing in the report builder

Post by Chellammal » 04 Mar 2005, 18:18

 Posted by:  Chellammal 

Hi All,
We are currently storing the picture in the database and
retrieving from database and showing in the centura windows. We used Mimg
functionalities with centura SAL functions. But we could not able to send to
send report builder to show the picture. it is showing some chunk values. At
the same time I can able to send the picture from the drive. But our
customer wants to send the database stored picture. We are currently using
CTD 1.5.1 PTF 6 and SQL Server 2000.
Any suggestion would appreciated.

Regards,
A.Chellam

StefanM
Germany
Posts: 610
Joined: 10 Aug 2018, 15:57
Location: Bavaria

error - retrieving picture from database and showing in the report builder

Post by StefanM » 04 Mar 2005, 19:17

 Posted by:  Stefan Misch 

Please describe exactly how you are retrieving the picture from the database
and how you transfer it to the report. What do you use as bind variable and
do you use SqlSetLongBindDatatype( .., DT_Binary) between SqlPrepare( ) and
SqlExecute( ) before fetching the picture. What do you mean with "chunk
values"? Do you see something like "BM" followed by some none-letter
characters instead of the picture in your report?

Stefan

Chellammal

error - retrieving picture from database and showing in the report builder

Post by Chellammal » 05 Mar 2005, 08:51

 Posted by:  Chellammal 

Hello Stefan and all
Thank you for your quick response. I used the same way as you
said. Look this piece of code...

!!CB!! 70
Call SqlConnect(hSqlImage)
Set Sql='select PIC into :strPicture
from PICTURE where part = :str[0] '
Call SqlPrepare(hSqlImage,Sql)
Call SqlSetLongBindDatatype(1,23)
Call SqlExecute(hSqlImage)
Call SqlFetchNext(hSqlImage,nFetch )
Set nImage = MImgLoadFromString( strPicture, MIMG_TYPE_JPG , 0 )
Call MImgCtlSetImage( pic1, nImage, TRUE )
Call SalPicGetString ( pic1, PIC_FormatObject, sPicture )

sPicture long string is passed to the report builder. In report builder, The
put the picture object and the this input variable of report builder is
object data type.

It is showing some four character values like as attached one. But
there is no BM or JPG etc.

Thanks in advance

Regards,
A.Chellammal

Attachment: pic.bmp

StefanM
Germany
Posts: 610
Joined: 10 Aug 2018, 15:57
Location: Bavaria

error - retrieving picture from database and showing in the report builder

Post by StefanM » 05 Mar 2005, 09:33

 Posted by:  Stefan Misch 

Chellammal,

why do you use PIC_FormatObject in SalPicGetString( )? PIC_FormatObject
means that the picture is an OLE object. Please use PIC_FormatBitmap.

Stefan

Return to “advanced.programming”

Who is online

Users browsing this forum: [Ccbot] and 0 guests