RE:EXPORTAR IMAGENES DE CAMPO GENERAL
Con VFP 9
Extractar graficas de campos generales usando el ReportListiner
http://support.microsoft.com/kb/894819/EN-US/
Otra forma con VFP 6 hasta 9
*------------------------------------
* Program....: CopyGen
* Author.....: Martín Salías (with special thanks to Raymond Krauss)
* Date.......: 19/18/98
* Notes......: Replace the missing command COPY GENERAL
* Parameters.: tcTable, tcField = Table & Field
* Parameters.: tcBMPFileName = Filename to generate (if no extension supplied, BMP is assumed)
* Returns....: The lenght of the generated file (in bytes)
* See Also...:
*
Lparameters tcTable, tcField, tcBMPFileName
Local lnReturn, lcSaveArea
lnReturn = 0
lcSaveArea = SaveArea()
If Used( tcTable )
If "." $ tcBMPFileName
* se pasó con extensión
Else
* Se agrega la extensión BMP
tcBMPFileName = Allt( tcBMPFileName )
+ ".bmp"
Endif
Local lcTempFile
lcTempFile = Sys(2023) + "\" + Sys(3)
Select ( tcTable )
Copy Next 1 To ( lcTempFile ) Field ( tcField )
lcMemoFileName = lcTempFile + ".fpt"
If File( lcMemoFileName )
Local lnFPT, lnBMP
lnFPT = Fopen( lcMemoFileName, 10 ) &&
Open the Memo File
lnBMP = Fcreate( tcBMPFileName ) &&
Create the new Image File
If lnFPT > 0 And lnBMP > 0
&& If both files are open
Local lnSize, lnPointer
lnSize = Fseek( lnFPT, 0, 2 )
&& Find the total size of the memo
lnPointer = Fseek( lnFPT, 0 )
&& Return to the beginning
* PROBLEM, PROBLEM; fRead can't
Read more than 64K At once, so we have To
* read the whole picture on 64K
Blocks.
*
Local lnBytesLeft, lcReadBuffer,
lnBytesToRead
lnBytesLeft = lnSize
lcReadBuffer = ""
Do While lnBytesLeft > 0
lnBytesToRead = Iif(
lnBytesLeft > 65535, 65535, lnBytesLeft )
lnBytesLeft = lnBytesLeft -
lnBytesToRead
* Gets the binary data of
the Image
lcReadBuffer =
lcReadBuffer + Fread( lnFPT, lnBytesToRead )
Enddo
Local lnBMPStart, lcWriteBuffer
lnBMPStart = At( 'BM',
lcReadBuffer ) && find start of a BMP file
* Put the rest of the binary data
On the Buffer
lcWriteBuffer = Right(
lcReadBuffer, Len( lcReadBuffer ) - lnBMPStart + 1 )
lnReturn = Fwrite( lnBMP,
lcWriteBuffer ) && write to BMP file
Endif
Fclose( lnFPT )
&& close files
Fclose( lnBMP )
Delete File ( lcTempFile + ".*" )
Endif
Endif
RestArea( lcSaveArea )
Return lnReturn