Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Print images From SQL server y VFP9
Message
From
24/06/2006 10:40:33
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
How to Print images From SQL server y VFP9
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01131413
Message ID:
01131413
Views:
69
Using recorset:
you need to create a PRG, ep:rptimage.prg inside it copy and paste this code i asuming that you have create a alias. sending a alias like a parameter(table).

PARAMETERS table

LOCAL loRL AS REPORTLISTENER

loRL = NEWOBJECT( 'PreviewListener' )
loRL.InitBLOBImage( '&tabla'+'.img' )

*-- Make sure that the cursor is selected,
*-- and then run the report to preview using
*-- the instance of our Report Listener.
SELECT &tabla
REPORT FORM Report2.frx OBJECT loRL
*CLOSE DATA ALL
RETURN



USE BlobReport.FRX IN 0 ALIAS TheReport EXCLUSIVE
SELECT TheReport
*-- Add the Picture/OLE Bound control record to the report.
APPEND BLANK IN TheReport
GATHER NAME loRL.oBlobImage MEMO

*-- Clean up and then close the report table.
PACK MEMO
USE IN SELECT( 'TheReport' )

*-- There has to be some way of redrawing the
*-- picture in the IMAGE class as the record pointer
*-- in the report's driving cursor changes; it does not occur
*-- automatically. This could be done by a UDF() in the PrintWhen
*-- of the OLE Bound control on the report, or as is illustrated here,
*-- by a Report Listener BEFOREBAND() Event.

DEFINE CLASS PreviewListener AS REPORTLISTENER
oBlobImage = NULL
PicBlobFld = ''
LISTENERTYPE = 1 && Preview Listener

PROCEDURE InitBLOBImage(lpcBlobField AS STRING)
THIS.PicBlobFld = lpcBlobField
THIS.oBlobImage = NEWOBJECT( 'IMAGE' )
THIS.oBlobImage.PICTUREVAL = THIS.PicBlobFld
ENDPROC

PROCEDURE BEFOREBAND( nBandObjCode, nFRXRecNo )
*-- Before the DETAIL band is rendered, ;
*-- just redraw the IMAGE object so that it has
*-- the correct picture from the BLOB field.
IF nBandObjCode = 4 && Detail band
THIS.oBlobImage.PICTUREVAL =;
EVALUATE( THIS.PicBlobFld )
ENDIF
ENDPROC
ENDDEFINE

After this just run from your application:

Do rptimage with 'table'

i asume that you have been create a table(alias) with your recorset.
Reply
Map
View

Click here to load this message in the networking platform