To all,
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
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
//----------------------------------------------------------------------------//
*********************************************
**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 NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 48 guests