I use xBrowse as a preview for a report.
Now I would like to print this report.
On each single line I would like to print the corresponding graph.
Does someone know how to convert oGraphs in silent mode to bmp.
Best regards,
Otto


I assume you are using the TGraph() class. If so, it has a Save2Bmp() method, have you tried that? I haven't tried it but I don't see anything that make it to be not silent.
METHOD Save2Bmp( cFile ) CLASS TGraph
LOCAL hBmp, hDib
DEFAULT cFile := "TGraph.Bmp"
hBmp := WndBitmap( Self:hWnd )
hDib := DibFromBitmap( hBmp )
DibWrite( cFile, hDib )
GloBalFree( hDib )
DeleteObject( hBmp )
RETURN ( FILE( cFile ) )
Best regards,
Robb

function printMonatsvgl()
local oVRD
local cBmp := ""
local I := 0
*----------------------------------------------------------
EASYREPORT oVRD NAME ".\xVRD\EasyReportExample1.vrd" //;
// PREVIEW lPreview TO cPrinter PRINTDIALOG IIF( lPreview, .F., .F. )
IF oVRD:lDialogCancel = .T.
RETURN( .F. )
ENDIF
select jahresvgl
go top
do while .not. eof()
I:= I + 1
PRINTAREA 2 OF oVRD
cbmp := "BMP" + ALLTRIM(STR(I))+".bmp"
if I > 12
IF oVRD:nNextRow > oVRD:nPageBreak
PAGEBREAK oVRD
// PRINTAREA 2 OF oVRD
ENDIF
PRINTAREA 4 OF oVRD;
ITEMIDS { 100,110,120,130,140,150,160,170 } ;
ITEMVALUES { jahresvgl->MONAT ,;
transform(jahresvgl->JAHR , "@E 9999,999" ),;
transform(jahresvgl->DIFF_J_1 , "@E 9999,999" ),;
transform(jahresvgl->JAHRMINUS1 , "@E 9999,999" ),;
transform(jahresvgl->JAHRMINUS2 , "@E 9999,999" ),;
transform(jahresvgl->JAHRMINUS3 , "@E 9999,999" ),;
transform(jahresvgl->JAHRMINUS4 , "@E 9999,999" ), cbmp }
else
PRINTAREA 3 OF oVRD;
ITEMIDS { 100,110,120,130,140,150,160,170 } ;
ITEMVALUES { jahresvgl->MONAT ,;
transform(jahresvgl->JAHR , "@E 9999,999" ),;
transform(jahresvgl->DIFF_J_1 , "@E 9999,999" ),;
transform(jahresvgl->JAHRMINUS1 , "@E 9999,999" ),;
transform(jahresvgl->JAHRMINUS2 , "@E 9999,999" ),;
transform(jahresvgl->JAHRMINUS3 , "@E 9999,999" ),;
transform(jahresvgl->JAHRMINUS4 , "@E 9999,999" ), cbmp }
endif
skip
enddo
oVRD:End()
select jahresvgl
go top
return nil
//----------------------------------------------------------------------------//Otto
In the spanish section of Easyreport forum they're making great progress and building an awesome product.
*********************************************
**esta funcion genera el bmp con los consumos
*********************************************
FUNCTION creabmp(vMan,vLot,vPer)
LOCAL oGraph ,aCan:={} ,aDia:={}
Local vRuta:=alltrim(vMan)+"-"+alltrim(vLot)+"-"+alltrim(vPer)
DEFINE DIALOG oDlg SIZE 600, 500
 Â
for n := 1 to 5
 AAdd(aDia,"mes"+Str(n))
 AAdd(aCan,n)
next  Â
 Â
@ 1, 1 GRAPH oGraph SIZE 250, 200 TYPE 1 XVALUES YVALUES 3D XGRID YGRID //LEGENDS
 Â
 oGraph:cTitX  :="Consumo Manzana"+alltrim(vMan)+" - Lote:"+alltrim(vLot)
 oGraph:cTitY  :="Meses"
 oGraph:lPopUp  :=.F.
 oGraph:nClrX = CLR_GREEN
 oGraph:nClrY = CLR_RED
 oGraph:AddSerie(aCan,"",RGB(128,128,255))
 Â
ACTIVATE DIALOG oDlg CENTER VALID (oGraph:save2bmp("c:\cartera\pictures\"+vRuta+".bmp"),.T.)
RETURN NILOtto,
I am not sure exactly what you are trying to do, but if you need to draw the graph, then save it to a bitmap, then you probably can draw it on an invisible window or dialog, then save it and end the window or dialog.
James