Jump to content
Fivewin Brasil

evertonlb

Membros
  • Posts

    733
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by evertonlb

  1. Opa.. Bom dia.. tenho uma solução na medida pra vc e para qualquer um que precisa enviar SMS.. Integra via API, Personaliza a aparência, envia em Long Code e Short Code. pode ser feito envio de mensagens concatenadas chegando a mais de 400 caracteres, envio de mensagens aceitando resposta do cliente, respondendo "Sim/Não" "1/2/3", etc. Temos uma taxa de mais de 90% de entrega/abertura, a taxa de conversão fica em média 25%. Nossa solução é munida de vários relatórios, um Dashboard muito bacana com muitos dados...Então Andriaz, estou oferecendo nossos serviços porque temos um valor bem agressivo de SMS, como trabalhamos com sub contas esse valor pode ser configurado e gerar mais uma renda para a sua empresa. Dá uma olhada.. qqer coisa fala comigo no skype -> everton@brasilfone.com.br https://pro.disparopro.com.br/integracao-via-api/
  2. Boa noite. Estou tentando compilar meu sistema com o MRBoleto, para evidentemente emitir boletos, mas dá um erro. Se alguém puder me dar uma dica?! O erro ocorre nas seguintes linhas Method Draw_Zebra( ... ) e na linha hb_zebra_draw( ::hZebra_______, {| x, y, w, z | HPDF_Page_Rectangle( ::oPage, x, y, w, z ) }, ... ) Mensagem do erro..: Error E0030 Syntax error: "parse error at '...'" Tô compilando junto o hbzebra.ch.. Att. Everton
  3. Eduardo.. o link expirou de novo. Se não for pedir muito, poderia me enviar no evertonlb@gmail.com? Obrigado!
  4. Eu só controlo o operador pelo código dele... para entrar no sistema cada um digita seu código e senha, assim no final do dia cara um faz o fechamento e o sistema só pega o movimento do operador atual...
  5. Kapiaba do céu... valeu mesmo cara. Eu mandava o "Chr(13) + Chr(10)" depois de cada linha... tirei.. deixei só o Chr(13) e funcionou!!
  6. Boa noite amigos. Tenha a impressão de etiquetas na Argox (vou colocar o código abaixo). Mas estou com um probleminha na impressão, não chega a impedir o uso da etiqueta, mas o cliente não quer que aconteça mais isso. O que está acontecendo é que no início da ultima linha que mando imprimir aparece uma letra "C"... Aparece a letra "C" e logo após imprime os dados que enviei.. mas só na última linha, nas anteriores não.. Alguém tem alguma ideia da solução? Local cLetra, nHand, cLote Local cArqImp := "Argox.TXT" Local cPrinter := PrinterPortToName( "Argox214" ) * nHand:=fCreate(cArqImp) * * Controle de cabeçalho da impressora * fWrite(nHand, "L" + Chr(13)+Chr(10) ) fWrite(nHand, "m" + Chr(13)+Chr(10) ) fWrite(nHand, "e" + Chr(13)+Chr(10) ) fWrite(nHand, "K1701"+ Chr(13)+Chr(10) ) fWrite(nHand, "PC" + Chr(13)+Chr(10) ) fWrite(nHand, "D11" + Chr(13)+Chr(10) ) fWrite(nHand, "H14" + Chr(13)+Chr(10) ) fWrite(nHand, "z" + Chr(13)+Chr(10) ) * * Montagem da Etiqueta 01 * * Esquema basico de enderecamento de etiquetas * na ALLEGRO DATAMAX. * * 1 1 1 1 000 0005 0130 EVERTON LUIS BATTISTON * ÄÂÄÂÄÂÄÂ ÄÂÄ ÄÄÂÄ ÄÄÂÄ ÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄ * ³ ³ ³ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄ Texto a ser impresso * ³ ³ ³ ³ ³ ³ ³ * ³ ³ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Posicao no eixo "X" * ³ ³ ³ ³ ³ ³ * ³ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Posicao no eixo "Y" * ³ ³ ³ ³ ³ * ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Altura do codigo de barra 000 altura padrao * ³ ³ ³ ³ * ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Largura da barra fina * ³ ³ ³ * ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Largura da barra larga * ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Tipo de codigo de barra * ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Orientacao anti-oraria: 1 - 0§, 2 - 240§, 3 - 180§, 4 - 90§ * * * Montagem da Etiqueta 01 * if !empty( Cod1 ) fWrite(nHand,"130002002400160" + "LH Laser" + CHR(13) + CHR(10) ) fWrite(nHand,"1F2205001400080" + Cod1 + CHR(13) + CHR(10) ) fWrite(nHand,"121100001000050" + Des1 + CHR(13) + CHR(10) ) fWrite(nHand,"190000200200050" + "CNPJ.:" + CNP1 + CHR(13) + CHR(10) ) endif * ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ * * SEGUNDA ETIQUETA * * ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ if !empty( Cod2 ) fWrite(nHand,"130002002400580" + "LH Laser" + CHR(13) + CHR(10) ) fWrite(nHand,"1F2205001400500" + Cod2 + CHR(13) + CHR(10) ) fWrite(nHand,"121100001000470" + Des2 + CHR(13) + CHR(10) ) fWrite(nHand,"190000200200470" + "CNPJ.:" + CNP2 + CHR(13) + CHR(10) ) endif * * Comandos de quantidade e finalização da impressora * fWrite(nHand,"Q"+ strzero( QtdeEtique, 4, 0 ) + Chr(13)+Chr(10) ) fwrite(nHand,"E" + Chr(13)+Chr(10) ) fClose(nHand) * cPrintEt := "Argox214" PrintFileRaw( cPrintEt, cArqImp, "Etiquetas - Estoque" ) * Ta ai.. Obrigado por qualquer dica! Att. Everton Battiston
  7. Pois é.. confusão, mas consigo me achar ali no meio. Sou aprendiz sim... tanto que estou com um problema que não consegui solucionar... Obrigado por todas as dicas.. vou ver e fazer as alterações sugeridas.
  8. /* nTipo (Tipos de Gráficas lineales soportados) -------------------------------------------------- #define RMC_LINE 21 #define RMC_AREA 22 nEstilo (Estilo de Gráficas de Lineas soportados) -------------------------------------------------- #define RMC_LINE_FLAT 21 #define RMC_LINE_FLAT_DOT 19 #define RMC_LINE_FLAT_DASH 18 #define RMC_LINE_CABLE 22 #define RMC_LINE_3D 23 #define RMC_LINE_3D_GRADIENT 24 #define RMC_AREA_FLAT 25 #define RMC_AREA_FLAT_GRADIENT_V 26 #define RMC_AREA_3D 29 #define RMC_AREA_3D_GRADIENT_V 30 nTipo (Tipos de Gráficos de Barra soportados) -------------------------------------------------- #define RMC_BARSINGLE 1 #define RMC_BARGROUP 2 #define RMC_BARSTACKED 3 #define RMC_BARSTACKED100 4 #define RMC_FLOATINGBAR 5 #define RMC_FLOATINGBARGROUP 6 nEstilo (Estilo de Gráficos de Barra soportados) -------------------------------------------------- #define RMC_BAR_FLAT 1 #define RMC_BAR_FLAT_GRADIENT1 2 #define RMC_BAR_FLAT_GRADIENT2 3 #define RMC_BAR_HOVER 4 #define RMC_COLUMN_FLAT 5 #define RMC_BAR_3D 6 #define RMC_BAR_3D_GRADIENT 7 #define RMC_COLUMN_3D 8 #define RMC_COLUMN_3D_GRADIENT 9 #define RMC_COLUMN_FLUTED 10 nEstilo ( Estilo de Gráficos Pastel soportados ) #define RMC_PIE_FLAT 51 #define RMC_PIE_GRADIENT 52 #define RMC_PIE_3D 53 #define RMC_PIE_3D_GRADIENT 54 #define RMC_DONUT_FLAT 55 #define RMC_DONUT_GRADIENT 56 #define RMC_DONUT_3D 57 #define RMC_DONUT_3D_GRADIENT 58 #define RMC_PYRAMIDE 59 #define RMC_PYRAMIDE3 60 // Alineación Pastel /Donut #define RMC_FULL 1 #define RMC_HALF_TOP 2 #define RMC_HALF_RIGHT 3 #define RMC_HALF_BOTTOM 4 #define RMC_HALF_LEFT 5 */ //------------------- STATIC CntValSeries //------------------- #include "FiveWin.ch" //Para RMCHart #include "hbdll.ch" #include "Rmchart.ch" // Look at this file to see keywords for 174 colors and #include "DllxHb.ch" // other constants. #include "cstruct.ch" #include "wintypes.ch" #include "RMChart2.ch" #define True 1 #define False 0 #define HH_DISPLAY_INDEX 2 #define CLR_RMCBLUE nRGB(99,148,236) // = "AliceBlue" #define CLR_RMCGOLD nRGB(248,208,0) // = "Gold" #define CLR_RMCBRONZE nRGB(221,204,163) // = "Metallic Bronze" #define TAB CHR(9) #command QUIT => ( PostQuitMessage( 0 ), __Quit() ) // suggested by Enrico //Fin para RMChart /*-------------------------------------------------------------------------------------------------------- FUNCION PARA GRAFICOS DE LINEAS Y AREAS SINTAXIS DE LA FUNCION GLINEAL: glineal( oWnd, cTit, cTitY, TituloY, aVals, aXLabels, nTipo, nEstilo, aLegSeries ) ventana, titulo superior, Titulo Eje Y, Valores de las series, etiquetas eje X, tipo de grafica lineal, estilo de la gráfica, Leyendas ----------------------------------------------------------------------------------------------------------*/ FUNCTION gLineal( oWnd, cTit, cTitY, aVals, aXLabels, nTipo, nEstilo, aLegSeries, lEtiqVals ) LOCAL i := 0, j:=0 LOCAL nRetVal := 0, sLabels := "" LOCAL oData IS DataStructD300 //20 LOCAL aColores, YminV, YmaxV aColores := { ColorDeepYellow, ColorBlue, ColorDarkBrown, ColorDeepRose, ColorCoral } CntValSeries := If( Len( aXLabels )>20, 20, Len( aXLabels ) ) YminV := 0 YmaxV := AMaxElement( aVals ) + AMaxElement( aVals ) / 10 ID_RMC1 := 100 IF lEtiqVals EtiqVals:=RMC_VLABEL_DEFAULT ELSE EtiqVals:=RMC_VLABEL_NONE ENDIF //Paso a variables públicas P_nTipo := nTipo P_nEstilo := nEstilo //************** Creo la gráfica ********************** nRetVal = RMC_CreateChart( ; oWnd:hWnd , ; // nParentHandle ID_RMC1 , ; // nCtrlID 0 , ; // nTop 0 , ; // nLeft WndWidth(oWnd:hWnd) -22 , ; // nWidth WndHeight(oWnd:hWnd) -80 , ; // nHeight ColorAliceBlue , ; // nBackColor RMC_CTRLSTYLEFLAT , ; // nCtrlStyle False , ; // nExportOnly "paper.jpg" , ; // sBgImage "Tahoma" , ; // sFontName 0 , ; // nToolTipwidth 0 ; // nBitmapBKColor ) If nRetVal < 0 ; IsError(1) ; RETURN nil ; EndIf //************** Agrego Región ***************************** nRetVal = RMC_AddRegion( ; ID_RMC1 , ; // nCtrlID 5 , ; // nLeft 5 , ; // nTop -5 , ; // nWidth -6 , ; // nHeight "Logos - Avaliação do Desenvolvimento Escolar - V 0.90", ; // sFooter False ; // nShowBorder ) If nRetVal < 0 ; IsError(2) ; RETURN nil ; EndIf //************** Titulo de la Región ******************* nRetVal = RMC_AddCaption( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion cTit , ; // sCaption este es el titulo del gráfico. ColorAquamarine , ; // nBackColor ColorBlack , ; // nTextColor 10 , ; // nFontSize True ; // nIsBold ) If nRetVal < 0 ; IsError(3) ; RETURN nil ; EndIf //************** Grilla de la Región ***************************** nRetVal = RMC_AddGrid( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion ColorBabyBlue , ; // nGridBackColor ColorBlack ColorBeige False , ; // nAsGradient 0 , ; // nLeft 0 , ; // nTop 0 , ; // nWidth 0 , ; // nHeight RMC_BICOLOR_LABELAXIS ; // nBiColor ) If nRetVal < 0 ; IsError(4) ; RETURN nil ; EndIf //********** Rango de valores Y a Región (min max)****************** nRetVal = RMC_AddDataAxis( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion RMC_DATAAXISLEFT , ; // nAlignment 0.0 , ; // nMinValue -DOUBLE so MUST have decimal!! YmaxV , ; // nMaxValue -DOUBLE so MUST have decimal!! CntValSeries , ; // nTickCount 8 , ; // nFontsize ColorBlack , ; // nTextColor ColorBlack , ; // nLineColor RMC_LINESTYLESOLID , ; // nLinestyle 0 , ; // nDecimalDigits "" , ; // sUnit cTitY , ; // sText "" , ; // sLabels RMC_TEXTCENTER ; // nLabelAlignment ) If nRetVal < 0 ; IsError(5) ; RETURN nil ; EndIf //*********************** Leyendas de datos *************** sLegend:= "" FOR i = 1 to Len( aLegSeries ) sLegend += ( aLegSeries[i] + "*" ) NEXT nRetVal = RMC_AddLegend( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLegend , ; // sLegend RMC_LEGEND_CUSTOM_TOP, ; // nLegendAlign ColorAliceBlue , ; // nLegendBackColor RMC_LEGENDRECT , ; // nLegendStyle ColorCoral , ; // nLegendTextColor ColorDarkBlue 8 , ; // nLegendFoltSize False ; // nLegendIsBold ) If nRetVal < 0 ; IsError(6) ; RETURN nil ; EndIf //***********************Agrego etiquetas a eje X *************** sLabels := "" FOR i=1 to CntValSeries sLabels+= aXLabels[i] + "*" next nRetVal = RMC_AddLabelAxis( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLabels , ; // sLabels (separated by asterisk) 1 , ; // nCount CntValSeries , ; // ntickCount //cantidad de etiquetas ojo!! RMC_LABELAXISBOTTOM , ; // nAlignment 8 , ; // nFontSize ColorBlack , ; // ntextColor RMC_TEXTCENTER , ; // nTextAlignment ColorBlack , ; // nLineColor RMC_LINESTYLENONE , ; // nLineStyle "" ; // sText ) If nRetVal < 0 ; IsError(7) ; RETURN nil ; EndIf //************** Agrego Series a la Región ******************************* //****** Transfiero los datos a través de variables de gráfica************ FOR j=1 to Len( aVals ) FOR i=1 to CntValSeries //se fuerza un maximo de 20 valores por serie. oData:nDouble[i] := aVals[j,i] NEXT i nRetVal = RMC_AddLineSeries( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion oData[1] , ; // nFirstDataValue CntValSeries , ; // nDataValuesCount 0 , ; // nFirstPPCValue 0 , ; // nPPCValuesCount nTipo , ; // nType RMC_LINE_3D_GRADIENT , ; // nStyle nEstilo , ; // nLineStyle False , ; // nIsLucent aColores[j] , ; // nColor RMC_SYMBOL_POINT , ; // nSymbol 1 , ; // nWhichDataAxis EtiqVals , ; // nValueLabelOn RMC_HATCHBRUSH_OFF ; // nHatchMode ) NEXT j nRetVal = RMC_Draw( ID_RMC1 ) If nRetVal < 0 ; IsError(8) ; RETURN nil ; EndIf RETURN ID_RMC1 /* *------------------------------------------------------------------------------------------------- * * FUNCION PARA GRAFICOS DE BARRAS * SINTAXIS DE LA FUNCION GLINEAL: * * gBarras( oWnd, cTit, cTitY, TituloY, aVals, aXLabels, nTipo, nEstilo, aLegSeries, lh ) * ventana, titulo superior, Titulo Eje Y, Valores de las series, * etiquetas eje X, tipo de grafica lineal, estilo de la gráfica, Leyendas , orientación horizontal *------------------------------------------------------------------------------------------------- **/ FUNCTION gBarras( oWnd, cTit, cTitY, aVals, aXLabels, nTipo, nEstilo, aLegSeries, lEtiqVals, lh ) LOCAL i := 0, j:=0 LOCAL nRetVal := 0, sLabels := "" LOCAL oData IS DataStructD300 //20 LOCAL aColores, YminV, YmaxV DEFAULT lh := .f. aColores := { ColorBlue, ColorGreen, ColorRed, ColorDeepYellow, ColorDarkBrown, ColorDeepRose, ColorCoral, ColorBrown } CntValSeries := If( Len( aXLabels )>20, 20, Len( aXLabels ) ) YminV := 0 YmaxV := AMaxElement( aVals ) + AMaxElement( aVals ) / 10 ID_RMC1 := 100 IF lEtiqVals EtiqVals:=RMC_VLABEL_DEFAULT ELSE EtiqVals:=RMC_VLABEL_NONE ENDIF IF lh Alineac := RMC_DATAAXISBOTTOM LegAlineac := RMC_LEGEND_CUSTOM_RIGHT labAlineac := RMC_LABELAXISLEFT ELSE Alineac := RMC_DATAAXISLEFT LegAlineac := RMC_LEGEND_CUSTOM_TOP labAlineac := RMC_LABELAXISBOTTOM ENDIF //Paso a variables públicas P_nTipo := nTipo P_nEstilo := nEstilo //************** Creo la gráfica ********************** nRetVal = RMC_CreateChart( ; oWnd:hWnd , ; // nParentHandle ID_RMC1 , ; // nCtrlID 0 , ; // nTop 0 , ; // nLeft WndWidth(oWnd:hWnd) -22 , ; // nWidth WndHeight(oWnd:hWnd) -86 , ; // nHeight ColorAzure , ; // nBackColor RMC_CTRLSTYLEFLAT , ; // nCtrlStyle False , ; // nExportOnly "paper.jpg" , ; // sBgImage "" , ; // sFontName 20 , ; // nToolTipwidth 0 ; // nBitmapBKColor ) If nRetVal < 0 ; IsError(9) ; RETURN nil ; EndIf //************** Agregar Región ***************************** nRetVal = RMC_AddRegion( ; ID_RMC1 , ; // nCtrlID 5 , ; // nLeft 5 , ; // nTop -5 , ; // nWidth -6 , ; // nHeight "Veesor - Automação Comercial - V. 0.8.A", ; // sFooter False ; // nShowBorder ) If nRetVal < 0 ; IsError(10) ; RETURN nil ; EndIf //************** Agregar titulo Región ******************* nRetVal = RMC_AddCaption( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion cTit , ; // sCaption ColorAquamarine , ; // nBackColor ColorBlack , ; // nTextColor 10 , ; // nFontSize True ; // nIsBold ) If nRetVal < 0 ; IsError(11) ; RETURN nil ; EndIf //************** Grilla de la Región 1 ***************************** nRetVal = RMC_AddGrid( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion ColorBeige , ; // nGridBackColor False , ; // nAsGradient 0 , ; // nLeft 0 , ; // nTop 0 , ; // nWidth 0 , ; // nHeight RMC_BICOLOR_LABELAXIS ; // nBiColor ) If nRetVal < 0 ; IsError(12) ; RETURN nil ; EndIf //********** Rango de valores Y a Región (min max)****************** nRetVal = RMC_AddDataAxis( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion Alineac , ; // nAlignment 0.0 , ; // nMinValue -DOUBLE so MUST have decimal!! YmaxV , ; // nMaxValue -DOUBLE so MUST have decimal!! CntValSeries , ; // nTickCount 8 , ; // nFontsize ColorBlack , ; // nTextColor ColorBlack , ; // nLineColor RMC_LINESTYLESOLID , ; // nLinestyle 0 , ; // nDecimalDigits "" , ; // sUnit cTitY , ; // sText "" , ; // sLabels RMC_TEXTCENTER ; // nLabelAlignment ) If nRetVal < 0 ; IsError(13) ; RETURN nil ; EndIf //*********************** Leyenda de datos *************** sLegend:= "" FOR i = 1 to Len( aLegSeries ) sLegend += ( aLegSeries[i] + "*" ) NEXT nRetVal = RMC_AddLegend( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLegend , ; // sLegend LegAlineac , ; // nLegendAlign ColorAliceBlue , ; // nLegendBackColor RMC_LEGENDRECT , ; // nLegendStyle ColorDarkBlue , ; // nLegendTextColor 8 , ; // nLegendFoltSize False ; // nLegendIsBold ) If nRetVal < 0 ; IsError(14) ; RETURN nil ; EndIf /* // Establece Rojo para la tercer barra: nRetVal = RMC_SetSeriesColor( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion 1 , ; // nSeries ColorRed , ; // nColor 3 ; // nIndex - bar # to get color ) */ //************** Agregar etiquetas de eje X ***************************** sLabels = "" FOR i=1 to CntValSeries sLabels+= aXLabels[i] + "*" next nRetVal = RMC_AddLabelAxis( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLabels , ; // sLabels (separated by asterisk) 1 , ; // nCount CntValSeries , ; // ntickCount RMC_LABELAXISBOTTOM , ; // nAlignment 8 , ; // nFontSize ColorBlack , ; // ntextColor RMC_TEXTCENTER , ; // nTextAlignment ColorBlack , ; // nLineColor RMC_LINESTYLENONE , ; // nLineStyle "" ; // sText ) If nRetVal < 0 ; IsError(15) ; RETURN nil ; EndIf //************** Agregar Series a Región ******************************* //****** Transfiero los datos a través de variables de gráfica************ FOR j=1 to Len(aVals) FOR i=1 to CntValSeries oData:nDouble[i] := aVals[j,i] NEXT i nRetVal = RMC_AddBarSeries( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion oData[1] , ; // nFirstDataValue CntValSeries , ; // nDataValuesCount nTipo , ; // nType RMC_COLUMN_3D_GRADIENT , ; // nEstilo nStyle False , ; // nIsLucent aColores[j] , ; // nColor lh , ; // nIsHorizontal 1 , ; // nWhichAxis EtiqVals , ; // nValuelabelOn 1 , ; // nPointsPerColumn RMC_HATCHBRUSH_OFF ; // nHatchMode ) //RMC_VLABEL_DEFAULT pone etiquetas de valores RMC_VLABEL_NONE no. NEXT j nRetVal = RMC_Draw( ID_RMC1 ) If nRetVal < 0 IsError(16) RETURN nil EndIf RETURN ID_RMC1 FUNCTION IsError(nError) DEFAULT nError := 0 MsgAlert( "Ocorreu um erro em: "+LTRIM(STR(nError)) +CRLF+; "Por Favor, anote este código." ) // Each error number can be traced to a specific place in this prg. RETURN nil *---------------------------- FUNCTION AMaxElement( aArray ) LOCAL i, j, aProv:={}, nmax:=0.0, ntot:=0.0 IF gnTipo = RMC_BARSTACKED FOR i= 1 to CntValSeries FOR j= 1 to Len( aArray ) ntot+=aArray[j,i] NEXT j If nmax < ntot nmax:=ntot ENDIF ntot:=0.0 NEXT i ELSE FOR j= 1 to Len( aArray ) FOR i=1 to CntValSeries //limito a 20 por si pasan mas. If nmax < aArray[j,i] nmax:=aArray[j,i] ENDIF NEXT i NEXT j ENDIF RETURN nmax /* ------------------------------------------------------------------------------------------------------------- Generación de Gráficos Pastel FUNCION gPastel() ------------------------------------------------------------------------------------------------------------- */ FUNCTION gPastel( oWnd, cTit, nEstilo, nAlign, aVals, aLegend, nCor_Gr ) LOCAL nRetVal := 0 LOCAL sLegend := "" LOCAL oColor IS ColorStructL5 LOCAL oData IS DataStructD20 //************** Create the chart ********************** nRetVal = RMC_CreateChart( ; oWnd:hWnd , ; // nParentHandle ID_RMC1 , ; // nCtrlID 0 , ; // nTop 0 , ; // nLeft WndHeight(oWnd:hWnd) -86 , ; // nWidth WndHeight(oWnd:hWnd) -86 , ; // nHeight ColorTransparent , ; // nBackColor RMC_CTRLSTYLEIMAGETILED , ; // nCtrlStyle False , ; // nExportOnly "imagens\BaloesGde.JPG" , ; // sBgImage //"paper.jpg" "" , ; // sFontName 0 , ; // nToolTipwidth 0 ; // nBitmapBKColor ) If nRetVal < 0 ; IsError(1) ; RETURN nil ; EndIf //************** Add Region 1 ***************************** nRetVal = RMC_AddRegion( ; ID_RMC1 , ; // nCtrlID 5 , ; // nLeft 5 , ; // nTop -5 , ; // nWidth -6 , ; // nHeight "Veesor - Automação Comercial - V. 1.37D", ; // sFooter False ; // nShowBorder ) If nRetVal < 0 ; IsError(2) ; RETURN nil ; EndIf //************** Add legend to region 1 ******************************* sLegend = "" FOR i= 1 to Len( aLegend ) sLegend += ( aLegend[i] + "*" ) NEXT i nRetVal = RMC_AddLegend( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion sLegend , ; // sLegend RMC_LEGEND_ONVLABELS, ; // nLegendAlign ColorGainsboro , ; // nLegendBackColor RMC_LEGENDNORECT , ; // nLegendStyle ColorBlue , ; // nLegendTextColor 8 , ; // nLegendFoltSize False ; // nLegendIsBold ) If nRetVal < 0 ; IsError(3) ; RETURN nil ; EndIf //************** Add Series 1 to region 1 ******************************* //****** Read color values ****** if nCor_Gr == 2 // bom.. o que eu fiz foi o seguinte // Ao gerar os graficos do PsicoMotor ele acabava tendo as mesmas // cores do Socio Afetivo, ai ficava muito confuso. Entao eu coloquei um // outro parametro na chamada do GPastel2. coloquei um numero no final // ai consigo trocar as cores sem problema.. // oColor:nLong[1] := ColorMediumVioletRed oColor:nLong[2] := ColorOrange oColor:nLong[3] := ColorIndigo oColor:nLong[4] := ColorBlue // Your data goes colors into these 5 slots oColor:nLong[5] := ColorDeepRose else oColor:nLong[1] := ColorDeepYellow oColor:nLong[2] := ColorRed oColor:nLong[3] := ColorGreen oColor:nLong[4] := ColorBlue // Your data goes colors into these 5 slots oColor:nLong[5] := ColorDeepRose endif //****** Read data values ****** FOR i = 1 to Len( aVals) oData:nDouble[i] := aVals[i] NEXT i nRetVal = RMC_AddGridlessSeries( ; ID_RMC1 , ; // nCtrlID 1 , ; // nRegion oData[1] , ; // nFirstDataValue Len( aVals ) , ; // nDataValuesCount oColor[1] , ; // nFirstColorValue 5 , ; // ncolorValuesCount nEstilo , ; // nStyle RMC_PIE_GRADIENT RMC_DONUT_GRADIENT RMC_PYRAMIDE RMC_PYRAMIDE3 RMC_PIE_3D_GRADIENT RMC_PIE_3D nAlign , ; // nAlignment 0 , ; // nExplodemode False , ; // nIsLucent RMC_VLABEL_TWIN , ; // nValueLabelOn RMC_HATCHBRUSH_OFF , ; // nHatchMode 0 ; // nStartAngle ) If nRetVal < 0 ; IsError(4) ; RETURN nil ; EndIf nRetVal = RMC_COText( ; ID_RMC1 , ; // nCtrlID 1 , ; // nCOIndex cTit , ; // sText 70 , ; // nLeft 20 , ; // nTop 300 , ; // nWidth (optional, as are the following...) 250 , ; // nHeight RMC_BOX_NONE , ; // nStyle 0 , ; // nBGColor 0 , ; // nLineColor 0 , ; // nTransparency 0 , ; // nLineAlignment ColorBlack , ; // nTextColor "10C" ; // sTextProperties ) If nRetVal < 0 ; IsError(5) ; RETURN nil ; EndIf //-------------------------------------------------- nRetVal = RMC_Draw( ID_RMC1 ) If nRetVal < 0 ; IsError(6) ; RETURN nil ; EndIf RETURN ID_RMC1 //---------------------------- RMC4XHB.PRG EjemLin.prg EjemBar.prg EjemPastel.prg RMCHART.CH RMCHART2.CH rmchartx.ch
  9. Pessoal.. não lembro de onde peguei isso.. mas são funções para usar o RMChart. Segue os PRG´s #include "FiveWin.ch" //Para RMCHart #include "hbdll.ch" #include "Rmchart.ch" #include "DllxHb.ch" #include "cstruct.ch" #include "wintypes.ch" #include "RMChart2.ch" /* // GridlessSeries styles #define RMC_PIE_FLAT 51 #define RMC_PIE_GRADIENT 52 #define RMC_PIE_3D 53 #define RMC_PIE_3D_GRADIENT 54 #define RMC_DONUT_FLAT 55 #define RMC_DONUT_GRADIENT 56 #define RMC_DONUT_3D 57 #define RMC_DONUT_3D_GRADIENT 58 #define RMC_PYRAMIDE 59 #define RMC_PYRAMIDE3 60 // Pie and Donut alignments #define RMC_FULL 1 #define RMC_HALF_TOP 2 #define RMC_HALF_RIGHT 3 #define RMC_HALF_BOTTOM 4 #define RMC_HALF_LEFT 5 */ // ****************************************************************************** * Sistema .....: BS.Escola * Programa ....: EjemPastel.prg * Autor .......: Everton Battiston * Sintese .....: Gera Graficos Pizza e Donuts * Data ........: 19/8/2011 às 00:23:11 * Revisado em .: 19/8/2011 às 00:23:11 ****************************************************************************** PROCEDURE EjemPastel(ccTitulo, ccTituloLateral, vValores, vLabels, vLegendas) LOCAL cPath PUBLIC gcTitulo, gaVals, gnEstilo, gaLegend, gnAlign PUBLIC p_nTipo, p_nEstilo, IdG cPath := CurDrive()+":\"+CurDir() gcTitulo := ccTitulo + " " + CRLF + " " + ccTituloLateral gnEstilo := RMC_PIE_3D_GRADIENT gnAlign := RMC_FULL gaVals := vValores gaLegend := vLegendas IF YEAR(DATE()) < 2099 SET EPOCH TO (YEAR( DATE() ) - 80) ELSE SET EPOCH TO 2000 ENDIF SET DATE TO FRENCH hRmcDll := LoadLibrary( "RMCHART.DLL" ) SETHandle(hRmcDll) //Send hRmcDll to Rmc4xHb.prg SET _3DLOOK ON DEFINE BRUSH oBrush COLOR GetSysColor(15) DEFINE DIALOG oWnd TITLE "Veesor Gráficos" from 50, 50 TO 600, 570 PIXEL COLOR 0, 15591915 *SET MESSAGE OF oWnd TO "de: José Murugosa" ; *CENTERED DATE KEYBOARD 2007 ACTIVATE DIALOG oWnd; ON INIT ( BuildMenu(oWnd), IdG := gPastel( oWnd, gcTitulo, gnEstilo, gnAlign, gaVals, gaLegend ) ) centered RETURN *---------------------------- FUNCTION BuildMenu() //Permite seleccionar Tipo y Estilo de Gráfico MENU oMenu // 2007 MENUITEM "Tipo de Gráfico" ; ACTION nil ; MESSAGE "Gráfico Sem Grade" MENU MENUITEM "Pizza" ; ACTION nil ; MESSAGE "Gráfico Pizza" MENU MENUITEM "Pizza Plano" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_PIE_FLAT, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Pizza Plano" MENUITEM "Pizza Plano com Gradiente" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_PIE_GRADIENT, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Pizza Plano com Gradiente" MENUITEM "Pizza 3D" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_PIE_3D, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Pizza 3D" MENUITEM "Pizza 3D com Gradiente" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_PIE_3D_GRADIENT, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Pizza 3D com Gradiente" ENDMENU MENUITEM "Donuts" ; ACTION nil ; MESSAGE "Grafico Donuts" MENU MENUITEM "Donuts Plano" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_DONUT_FLAT, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico de Donuts plano" MENUITEM "Donuts Plano c/Gradiente" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_DONUT_GRADIENT, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico de Donuts com Gradiente" MENUITEM "Donuts 3d" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_DONUT_3D, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico de Donuts 3D" MENUITEM "Donuts 3d com Gradiente" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_DONUT_3D_GRADIENT, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Donuts 3D com Gradiente" ENDMENU MENUITEM "Piramide" ; ACTION nil ; MESSAGE "Grafico em Pirâmide" MENU MENUITEM "Pirâmide" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_PYRAMIDE, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Pizza 3D com Gradiente" MENUITEM "Pirâmide 3D" ; ACTION IdG := gPastel( oWnd, gcTitulo, RMC_PYRAMIDE3, gnAlign, gaVals, gaLegend ) ; MESSAGE "Gráfico Pizza 3D com Gradiente" ENDMENU ENDMENU MENUITEM "Ações" ; ACTION nil ; MESSAGE "Ações sobre o Gráfico" MENU MENUITEM "Guardar como Imagem" ; ACTION RMC_DRAW2FILE( IdG, "grafico.jpg",,, 100 ) ; MESSAGE "Guardar gráfico como Imagem JPG" MENUITEM "Enviar à Àrea de Transferência" ; ACTION RMC_DRAW2CLIPBOARD( IdG, P_nTipo ) ; MESSAGE "Enviar Gráfico à Àrea de Transferência" MENUITEM "Imprimir" ; ACTION RMC_DRAW2PRINTER( IdG ) ; MESSAGE "Imprimir o Gráfico" ENDMENU ENDMENU oWnd:SetMenu(oMenu) RETURN .t. FUNCTION EstiloBarras( nEst ) P_nEstilo := nEst FOR i=1 to Len( gaVals ) RMC_SetSeriesStyle( IdG, 1, i, P_nEstilo ) NEXT i RMC_DRAW( IdG ) RETURN nil FUNCTION TipoBarras( ntipo ) gnTipo:=ntipo gnEstilo := RMC_BAR_FLAT IdG := gBarras( oWnd, gcTitulo, gcTituloY, gaVals, gaXLabels, gnTipo, gnEstilo, gaLegSeries, glEtiqVals ) RETURN nil FUNCTION EsHorizontal( lh ) IdG := gBarras( oWnd, gcTitulo, gcTituloY, gaVals, gaXLabels, gnTipo, gnEstilo, gaLegSeries, glEtiqVals, lh ) return NIL #include "FiveWin.ch" //Para RMCHart #include "hbdll.ch" #include "Rmchart.ch" #include "DllxHb.ch" #include "cstruct.ch" #include "wintypes.ch" #include "RMChart2.ch" ****************************************************************************** * Sistema .....: BS.Escola * Programa ....: EjemBar.prg * Autor .......: Everton Battiston * Sintese .....: Fonte para gerar gráficos em BARRAS com o RMChart * Data ........: 7/9/2011 às 15:12:36 * Revisado em .: 7/9/2011 às 15:12:36 ****************************************************************************** PROCEDURE EjemBar(ccTitulo, ccTituloLateral, vValores, vLabels, vLegendas ) LOCAL cPath, nWleft, nWtop PUBLIC gcTitulo, gcTituloY, gaVals, gaXLabels, gnTipo, gnEstilo, gaLegSeries PUBLIC p_nTipo, p_nEstilo, IdG, IdG1, GlEtiqVals cPath := CurDrive()+":\"+CurDir() nWleft := 6 nWtop := 3 * gcTitulo := ccTitulo gcTituloY := ccTituloLateral gaVals := vValores gaXLabels := vLabels gnTipo := RMC_BARGROUP gnEstilo := RMC_BAR_FLAT gaLegSeries := vLegendas glEtiqVals := .f. IF YEAR(DATE()) < 2099 SET EPOCH TO (YEAR( DATE() ) - 80) ELSE SET EPOCH TO 2000 ENDIF SET DATE TO FRENCH hRmcDll := LoadLibrary( "RMCHART.DLL" ) SETHandle(hRmcDll) //Send hRmcDll to Rmc4xHb.prg SET _3DLOOK ON DEFINE BRUSH oBrush COLOR GetSysColor(15) DEFINE Dialog oDlg TITLE "Veesor Gráficos"; FROM 0, 0 TO 450, 730 pixel COLOR 0, 15591915 ACTIVATE Dialog oDlg ON INIT ( BuildMenu(oDlg), IdG:=gBarras( oDlg, gcTitulo, gcTituloY,; gaVals, gaXLabels, gnTipo, gnEstilo, gaLegSeries, glEtiqVals ) ) centered RETURN *---------------------------- FUNCTION BuildMenu() MENU oMenu MENUITEM "Tipo de Gráfico" ACTION nil; MESSAGE "Gráfico de Barras" MENU MENUITEM "Tipo de Barras" ACTION nil ; MESSAGE "Tipo de Barras" MENU MENUITEM "Barras Lado-a-Lado" ACTION TipoBarras( RMC_BARGROUP ) ; //RMC_BARGROUP MESSAGE "Gráfico de Barras Lado-a-Lado" MENUITEM "Barras Empilhadas" ACTION TipoBarras( RMC_BARSTACKED ) ; //RMC_BARSTACKED MESSAGE "Gráfico de Barras Empilhadas" ENDMENU MENUITEM "Orientação" ACTION nil ; MESSAGE "Orientação do Gráfico" MENU MENUITEM "Horizontal" ACTION EsHorizontal( .t. ) ; MESSAGE "Barras na Horizontal" MENUITEM "Vertical" ACTION EsHorizontal( .f. ) ; MESSAGE "Barras Vertical" ENDMENU MENUITEM "Estilo de Barras" ACTION nil ; // MESSAGE "Linhas" MENU MENUITEM "Barras Planas" ACTION EstiloBarras( RMC_BAR_FLAT ) ; MESSAGE "Gráfico de Barras Planas" MENUITEM "Barras Planas com Gradiente" ACTION EstiloBarras( RMC_BAR_FLAT_GRADIENT1 ) ; MESSAGE "Gráfico de Barras Planas com Gradiente" MENUITEM "Barras Planas com Gradiente Vertical" ACTION EstiloBarras( RMC_BAR_FLAT_GRADIENT2 ) ; MESSAGE "Gráfico de Barras Planas com Gradiente Vertical" MENUITEM "Barras 3D" ACTION EstiloBarras( RMC_BAR_3D ) ; MESSAGE "Gráfico de Barras 3D" MENUITEM "Barras 3D Gradiente" ACTION EstiloBarras( RMC_BAR_3D_GRADIENT ) ; MESSAGE "Gráfico de Barras 3D com Gradiente" MENUITEM "Colunas Gradiente" ACTION EstiloBarras( RMC_COLUMN_3D_GRADIENT ) ; MESSAGE "Gráfico de Colunas com Gradiente" ENDMENU ENDMENU MENUITEM "Ações" ; ACTION nil ; MESSAGE "Gráfico de Linhas" MENU MENUITEM "Guardar como Imagem" ACTION RMC_DRAW2FILE( IdG, "grafico.jpg",,, 100 ) ; MESSAGE "Guardar gráfico como arquivo JPG" MENUITEM "Enviar à Àrea de Transferência" ACTION RMC_DRAW2CLIPBOARD( IdG, P_nTipo ) ; MESSAGE "Enviar gráfico à Àrea de Transferência" MENUITEM "Imprimir" ACTION RMC_DRAW2PRINTER( IdG ) ; MESSAGE "Imprimir o gráfico" ENDMENU ENDMENU oDlg:SetMenu(oMenu) RETURN .t. FUNCTION EstiloBarras( nEst ) P_nEstilo := nEst FOR i=1 to Len( gaVals ) RMC_SetSeriesStyle( IdG, 1, i, P_nEstilo ) NEXT i RMC_DRAW( IdG ) RETURN nil FUNCTION TipoBarras( ntipo ) gnTipo:=ntipo gnEstilo := RMC_BAR_FLAT IdG := gBarras( oDlg, gcTitulo, gcTituloY, gaVals, gaXLabels, gnTipo, gnEstilo, gaLegSeries, glEtiqVals ) RETURN nil FUNCTION EsHorizontal( lh ) IdG := gBarras( oDlg, gcTitulo, gcTituloY, gaVals, gaXLabels, gnTipo, gnEstilo, gaLegSeries, glEtiqVals, lh ) return NIL
  10. Edu.. pode ser besteira.. mas eu dou um valid no get e du um retorno da variável com o Alltrim(). tentou isso? Att. Everton
  11. Muuuiiiitttttoooo tempo depois... O código para ver se tem algo de estranho... Amanhã esse negócio vai ter que funcionar na marra!!! #Include "Fivewin.ch" #Include "vrmm.ch" #Include "DtPicker.ch" #Include "URLLink.ch" #include "CORGET.CH" ************************************************** * Sistema .....: BS.Escola * Programa ....: VES09203.prg * Autor .......: Everton * Sintese .....: Relatório de Produtos Vendidos * Data ........: 04/05/2014 às 23:52:46 * Revisado em .: 04/05/2014 às 23:52:46 ****************************************************************************** Function VES09203() Private oGrp1, oGrp2, oGrp3,; oGet1, oGet2,; oRad1,; oDtP1, oDtP2,; oSay1, oSay2, oSay3, oSay4, oSay5, oSay6, oSay7,; oBtn1, oBtn2,; oChk1, oChk2 public _lTodasVendas := .f. public dDataInicial := Date() public dDataFinal := Date() public _lTodosOperadores := .t. public CodigoOperador := 0 Public NomeDoOperador := Space( 30 ) Public nTipoOrdem := 1 Public cCodSTMA := Space( 08 ) Public cNomeSec := Space( 20 ) Public cNomeTip := Space( 20 ) Public cNomeMar := Space( 20 ) * DEFINE FONT oFONT1 NAME "Arial" SIZE 0, -12 BOLD DEFINE FONT oFONT2 NAME "Arial" SIZE 0, -13 DEFINE FONT oFONT3 NAME "Ms Sans Serif" SIZE 0, -12 * Define DIALOG oForm_Prd_Vendidos TITLE "..: Produtos Vendidos :.." Style 1; FROM 118, 266 to 467, 748 PIXEL COLOR 0, 15790320 * ACTIVATE DIALOG oForm_Prd_Vendidos ON INIT Ini_oForm_Prd_Vendidos() centered Return NIL //---------------------------------------------------------------------------- Function Ini_oForm_Prd_Vendidos() @ 2, 6 GROUP oGrp1 TO 72, 470 LABEL "Período" PIXEL; OF oForm_Prd_Vendidos COLOR 0, 15790320 FONT oFont1 @ 15, 8 CHECKBOX oChk1 VAR _lTodasVendas PROMPT "Todas" SIZE 78, 20 ; COLOR 0, 15790320 PIXEL OF oGrp1 FONT oFont1 @ 41, 8 SAY oSay1 VAR "Data Inicial" SIZE 66, 16 PIXEL; OF oGrp1 COLOR 0, 15790320 FONT oFont2 @ 41, 246 SAY oSay2 VAR "Data Final" SIZE 62, 16 PIXEL; OF oGrp1 COLOR 0, 15790320 FONT oFont2 @ 39, 85 DTPICKER oDtP1 VAR dDataInicial SIZE 120, 20; COLOR 0, 15790320 PIXEL OF oGrp1 FONT oFont1 @ 39, 311 DTPICKER oDtP2 VAR dDataFinal SIZE 120, 20; COLOR 0, 15790320 PIXEL OF oGrp1 FONT oFont1 @ 72, 6 GROUP oGrp4 TO 142, 470 LABEL "Divisão de Estoque" PIXEL; OF oForm_Prd_Vendidos COLOR 0, 15790320 FONT oFont1 @ 20, 10 GET oGet2 VAR cCodSTMA SIZE 120, 20; COLOR 0, 16777215 PICTURE "@R 99.999.999" PIXEL OF oGrp4 FONT oFont1 valid VeStma( cCodSTMA ) @ 15, 140 SAY oSay5 VAR cNomeSec SIZE 250, 16 PIXEL; OF oGrp4 COLOR 0, 15790320 FONT oFont1 @ 32, 140 SAY oSay6 VAR cNomeTip SIZE 250, 16 PIXEL; OF oGrp4 COLOR 0, 15790320 FONT oFont1 @ 51, 140 SAY oSay7 VAR cNomeMar SIZE 250, 16 PIXEL; OF oGrp4 COLOR 0, 15790320 FONT oFont1 @ 144, 6 GROUP oGrp2 TO 214, 470 LABEL "Operador" PIXEL; OF oForm_Prd_Vendidos COLOR 0, 15790320 FONT oFont1 @ 16, 8 CHECKBOX oChk2 VAR _lTodosOperadores PROMPT "Todos" SIZE 86, 20 ; COLOR 0, 15790320 PIXEL OF oGrp2 FONT oFont1 @ 39, 61 GET oGet1 VAR CodigoOperador SIZE 73, 20; COLOR 0, 16777215 PICTURE "99999" PIXEL OF oGrp2 FONT oFont1 @ 41, 5 SAY oSay3 VAR "Código" SIZE 46, 16 PIXEL; OF oGrp2 COLOR 0, 15790320 FONT oFont1 @ 41, 146 SAY oSay4 VAR NomeDoOperador SIZE 310, 16 PIXEL; OF oGrp2 COLOR 0, 15790320 FONT oFont1 @ 215, 6 GROUP oGrp3 TO 288, 470 LABEL "Ordem" PIXEL; OF oForm_Prd_Vendidos COLOR 0, 15790320 FONT oFont1 @ 16, 8 RADIO oRad1 VAR nTipoOrdem Prompt "Alfabética",; "Código",; "Mais Vendidos",; "Maior Desconto",; "Maior Valor Final",; "Com Clientes"; SIZE 86, 20 PIXEL OF oGrp3 oRad1:aItems[1]:Move( 16, 8, 86, 20, .T. ) oRad1:aItems[1]:SetColor( 0, 15790320 ) oRad1:aItems[1]:SetFont( oFont2 ) oRad1:aItems[2]:Move( 41, 8, 70, 20, .T. ) oRad1:aItems[2]:SetColor( 0, 15790320 ) oRad1:aItems[2]:SetFont( oFont2 ) oRad1:aItems[3]:Move( 16, 154, 124, 20, .T. ) oRad1:aItems[3]:SetColor( 0, 15790320 ) oRad1:aItems[3]:SetFont( oFont2 ) oRad1:aItems[4]:Move( 41, 154, 126, 20, .T. ) oRad1:aItems[4]:SetColor( 0, 15790320 ) oRad1:aItems[4]:SetFont( oFont2 ) oRad1:aItems[5]:Move( 16, 323, 133, 20, .T. ) oRad1:aItems[5]:SetColor( 0, 15790320 ) oRad1:aItems[5]:SetFont( oFont2 ) oRad1:aItems[6]:Move( 41, 323, 133, 20, .T. ) oRad1:aItems[6]:SetColor( 0, 15790320 ) oRad1:aItems[6]:SetFont( oFont2 ) @ 292, 369 BTNBMP oBtn1 Prompt "Imprime"; FILE "Imagens\16\Printer.bmp" SIZE 100, 26 PIXEL ; OF oForm_Prd_Vendidos ACTION ImprimePrd() FONT oFont3 left oBtn1:SETCOLOR( 0, 14342874 ) @ 292, 269 BTNBMP oBtn2 Prompt "Cancela"; FILE "Imagens\16\Cancela.bmp" SIZE 100, 26 PIXEL ; OF oForm_Prd_Vendidos ACTION oForm_Prd_Vendidos:end() FONT oFont3 left oBtn2:SETCOLOR( 0, 14342874 ) Return NIL *-------------------------------------------* * * Define a Funcao ImprimePrd que Imprime o relatorio de produtos vendidos no periodo * * VES09203 28/05/2014 - 18:06:29 Everton * *----------------------------------------------------------* Static Function ImprimePrd() * set softseek ON * cCodSec := left( cCodSTMA, 2 ) cCodTip := substr( cCodSTMA, 3, 3 ) cCodMar := right( cCodSTMA, 3 ) * if !empty( cCodSec ) cCondSc := "left( PD_MARC, 2 ) == cCodSec" cTitSc := "* SEÇÃO.: " + cCodSec + " - " + left( cNomeSec, 30 ) + " *** " else cCondSc := ".t." cTitSc := "* SEÇÃO.: *** TODAS *** " endif * if !empty( cCodTip ) cCondTp := "substr( PD_MARC, 3, 3 ) == cCodTip" cTitTp := "* TIPO.: " + cCodTip + " - " + left( cNomeTip, 30 ) + " *** " else cCondTp := ".t." cTitTp := "* TIPO.: *** TODOS *** " endif * if !empty( cCodMar ) cCondMr := "right( PD_MARC, 3 ) == cCodMar" cTitMr := "* TIPO.: " + cCodMar + " - " + left( cNomeMar, 30 ) + " *** " else cCondMr := ".t." cTitMr := "* MARCA.: *** TODAS *** " endif * if _lTodasVendas dDataInicial := ctod( "01/01/2000" ) dDataFinal := date() Condi_1 := "VEN_DATA >= dDataInicial .and. VEN_DATA <= dDataFinal" else Condi_1 := "VEN_DATA >= dDataInicial .and. VEN_DATA <= dDataFinal" endif * if _lTodosOperadores Condi_2 := ".t." else Condi_2 := "VEN_VEND == CodigoOperador" endif * public _cNomArq := "T" + strzero( secs( time() ), 7, 0 ) if !_Abre( "TEMPP1.KI", _cNomArq, {"TEMPP1A.IND", "TEMPP1B.IND", "TEMPP1C.IND"}, {"DET_PEDI + DET_ITEM", "DET_ITEM", "DET_CLIE" }, .t., 2 ) if !_Abre( "TEMPP2.KI", _cNomArq, {"TEMPP2A.IND", "TEMPP2B.IND", "TEMPP2C.IND"}, {"DET_PEDI + DET_ITEM", "DET_ITEM", "DET_CLIE" }, .t., 2 ) if !_Abre( "TEMPP3.KI", _cNomArq, {"TEMPP3A.IND", "TEMPP3B.IND", "TEMPP3C.IND"}, {"DET_PEDI + DET_ITEM", "DET_ITEM", "DET_CLIE" }, .t., 2 ) break else n_xTemp := 3 endif else n_xTemp := 2 endif else n_xTemp := 1 endif * select ( _cNomArq ) set Order to 02 zap * select Produtos set order to 01 go top * select DetVenda set Order to 04 go top * select CabVenda set Order to 02 go top * if dbseek( dtos( dDataInicial ), .t. ) * do while !eof() .and. &Condi_1. * if &Condi_2. .and. !VEN_CANC CodVenda := VEN_SEQU CodCliVndRel := VEN_CLIE NomCliVndRel := alltrim( VEN_NOME ) * select DetVenda go top * if dbseek( CodVenda ) * do while DEV_PEDI == CodVenda * CodiProd := DEV_ITEM QtdeProd := DEV_QUAN ValoUnit := DEV_VALO DescProd := DEV_DESC TotaProd := DEV_TOTA NomeProd := DEV_NOME * select Produtos go top * if dbseek( CodiProd ) if &cCondSc. .and. &cCondTp. .and. &cCondMr. NomeProd := PD_DESC nEstoque := PD_ESTO + PD_ESPA * * Por cliente * select ( _cNomArq ) set Order to 02 go top * if !dbseek( CodiProd ) append blank replace DET_ITEM with CodiProd,; DET_QUAN with DET_QUAN + QtdeProd,; DET_VALO with ValoUnit,; DET_DESC with DET_DESC + DescProd,; DET_TOTA with DET_TOTA + TotaProd,; DET_NOME with NomeProd,; DET_CLIE with CodCliVndRel DbUnlock() else rlock() replace DET_QUAN with DET_QUAN + QtdeProd,; DET_VALO with DET_VALO + ValoUnit,; DET_DESC with DET_DESC + DescProd,; DET_TOTA with DET_TOTA + TotaProd endif * endif else NomeProd := "Produto Não Encontrado" endif * select DetVenda skip enddo endif endif * select CabVenda skip enddo endif * PRINT oPrinter FROM USER PREVIEW; NAME "Produtos Vendidos - Battiston Sistemas - (49)3323-8032" * DEFINE FONT oXFont NAME "ARIAL" SIZE 0, -8 OF oPrinter DEFINE FONT oXFont1 NAME "ARIAL" SIZE 0, -8 BOLD OF oPrinter DEFINE FONT oXFont2 NAME "ARIAL" SIZE 0, -10 OF oPrinter DEFINE FONT oXFont3 NAME "ARIAL" SIZE 0, -9 BOLD OF oPrinter DEFINE FONT oXFontC2 NAME "ARIAL" SIZE 0, -10 OF oPrinter DEFINE FONT oXFontC3 NAME "ARIAL" SIZE 0, -10 BOLD OF oPrinter DEFINE PEN oPen1 WIDTH 10 COLOR CLR_BLACK OF oPrinter * CursorWait() * select ( _cNomArq ) * if nTipoOrdem == 1 index on DET_NOME to Indi01.Ind elseif nTipoOrdem == 2 index on DET_ITEM to Indi01.Ind elseif nTipoOrdem == 3 index on DESCEND( DET_QUAN ) to Indi01.Ind elseif nTipoOrdem == 4 index on DESCEND( DET_DESC ) to Indi01.Ind elseif nTipoOrdem == 5 index on DESCEND( DET_TOTA ) to Indi01.Ind endif set index to Indi01.Ind go top * nRow := 0.50 nCol := 1.00 nContaLin := 1 nPagina := 1 nImpressos := 0 nCodAcha := Space( 07 ) nEstoque := 0 * oPrinter:SetPage(9) oPrinter:StartPage() ResLinha := oPrinter:nLogPixely() / 2.54 ResColuna := oPrinter:nLogPixelx() / 2.54 * __nProPec := __nDesTot := __nVndTot := __nProIte := 0 cTitulo2 := "Entre..: " + dtoc( dDataInicial ) + " e " + dtoc( dDataFinal ) * do while !eof() * if nPagina == 1 oPrinter:SayBitmap( nRow * ResLinha, 1.00 * ResColuna, "LogoImpr.BMP", 420 , 300 ) nRow += 0.50 oPrinter:say( nRow * ResLinha, 4.10 * ResColuna, cEmpresa, oXFontC3, 0 ) nRow += 0.50 oPrinter:say( nRow * ResLinha, 4.10 * ResColuna, cTelefone, oXFontC2, 0 ) nRow += 0.50 oPrinter:say( nRow * ResLinha, 4.10 * ResColuna, "Relatório de Produtos Vendidos" + " " + cTitulo2, oXFont1, 0 ) oPrinter:say( nRow * ResLinha, 17.50 * ResColuna, "Página.:" + strzero( nPagina, 3, 0 ), oXFont1, 0 ) nRow += 0.50 oPrinter:Say( nRow * ResLinha, 4.10 * ResColuna, cTitSc, oXFont ) nRow += 0.50 oPrinter:Say( nRow * ResLinha, 5.10 * ResColuna, cTitTp, oXFont ) nRow += 0.50 oPrinter:Say( nRow * ResLinha, 6.10 * ResColuna, cTitMr, oXFont ) nRow += 0.50 oPrinter:Line( nRow * ResLinha, 1.00 * ResColuna, nRow * ResLinha, (nCol + 18.1) * ResColuna ) nRow += 0.30 oPrinter:Say( nRow * ResLinha, 1.00 * ResColuna, " Código Descrição Vendida Estoque Valor Unitário Desconto Valor Total", oXFont1 ) nRow += 0.50 oPrinter:Line( nRow * ResLinha, 1.00 * ResColuna, nRow * ResLinha, (nCol + 18.1) * ResColuna ) nRow += 0.50 nPagina ++ nContaLin := 7 endif * nCodAcha := DET_ITEM select Produtos go top if dbseek( nCodAcha ) nEstoque := PD_ESTO + PD_ESPA endif * select ( _cNomArq ) CodCLiente := DET_CLIE * oPrinter:Say( nRow * ResLinha, 1.65 * ResColuna, transform( DET_ITEM, "@R 999999-9"), oXFont,,,,2 ) oPrinter:Say( nRow * ResLinha, 2.70 * ResColuna, alltrim(DET_NOME), oXFont,,,,0 ) oPrinter:Say( nRow * ResLinha, 10.00 * ResColuna, transform( DET_QUAN, "999,999" ), oXFont,,,,1 ) oPrinter:Say( nRow * ResLinha, 11.50 * ResColuna, transform( nEstoque, "999,999" ), oXFont,,,,1 ) oPrinter:Say( nRow * ResLinha, 14.00 * ResColuna, transform( DET_VALO, "999,999.99" ), oXFont,,,,1 ) oPrinter:Say( nRow * ResLinha, 16.50 * ResColuna, transform( DET_DESC, "999,999.99" ), oXFont,,,,1 ) oPrinter:Say( nRow * ResLinha, 19.00 * ResColuna, transform( DET_VALO * DET_QUAN, "999,999.99" ), oXFont,,,,1 ) nRow += 0.40 * nContaLin ++ * __nProIte ++ __nProPec += DET_QUAN __nDesTot += DET_DESC __nVndTot += DET_VALO * DET_QUAN * if nContaLin >= 57 nRow := 0.50 nCol := 1.00 oPrinter:endPage() oPrinter:StartPage() nContaLin := 1 nPagina := 1 SYSREFRESH() endif * skip enddo * if nContaLin >= 57 nRow := 0.50 nCol := 1.00 nContaLin := 1 oPrinter:endPage() oPrinter:StartPage() nPagina := 1 else nRow += 0.35 nContaLin ++ endif * oPrinter:Line( nRow * ResLinha, 1.00 * ResColuna, nRow * ResLinha, (nCol + 18.1) * ResColuna ) nRow += 0.50 oPrinter:Say( nRow * ResLinha, 1.00 * ResColuna, "TOTAIS DO RELATÓRIO -> Itens...: Peças..: Desc Concedidos.: Valor Total..:", oXFont ) * oPrinter:Say( nRow * ResLinha, 6.70 * ResColuna, transform( __nProIte, "999,999" ), oXFont1,,,,2 ) oPrinter:Say( nRow * ResLinha, 9.50 * ResColuna, transform( __nProPec, "999,999" ), oXFont1,,,,2 ) oPrinter:Say( nRow * ResLinha, 14.00 * ResColuna, transform( __nDesTot, "999,999.99" ), oXFont1,,,,2 ) oPrinter:Say( nRow * ResLinha, 18.00 * ResColuna, transform( __nVndTot, "999,999.99" ), oXFont1,,,,2 ) * nRow += 0.50 oPrinter:Line( nRow * ResLinha, 1.00 * ResColuna, nRow * ResLinha, (nCol + 18.1) * ResColuna ) * CursorArrow() * oPrinter:EndPage() oPrinter:Preview() select ( _cNomArq ) close * set softseek OFF Return .t. *-------------------------------* * Nome...: VeMarca * data...: 08/06/07 * funcao.: Verifica o codigo do Marca digitado, se encontra retorna o codigo * e imprime o nome, senao encontra, abre o ListBox com a opcao * de cadastrar. *---------------------------------------------------------------------* function VeSTMA( CodSTMA ) * CodSecao := left( CodSTMA, 2 ) CodTipo := left( CodSTMA, 5 ) CodMarca := CodSTMA * @ 15, 140 SAY oSay5 VAR cNomeSec SIZE 250, 16 PIXEL; select Secao set Order to 01 go top * if val( CodSecao ) > 0 if dbseek( CodSecao ) cNomeSec := alltrim( SEC_DESC ) oSay5:VarPut( cNomeSec ) oSay5:refresh() else MsgInfo( "Esta SEÇÃO não foi encontrada, verefique o código digitado!", "..: Atenção :.." ) select Produtos return .t. endif else cNomeSec := "Todas as Seções" oSay5:VarPut( cNomeSec ) oSay5:refresh() endif * select Tipo set Order to 01 go top * if Val( right( CodTipo, 3 ) ) > 0 if dbseek( CodTipo ) cNomeTip := alltrim( TIP_DESC ) oSay6:VarPut( cNomeTip ) oSay6:refresh() else MsgInfo( "Este SEÇÃO/TIPO não foi encontrado, verefique o código digitado!", "..: Atenção :.." ) select Produtos return .t. endif else cNomeTip := "Todas os Tipos" oSay6:VarPut( cNomeTip ) oSay6:refresh() endif * select Marca set Order to 01 go top * DEFINE FONT oFont8 NAME "Arial Black" SIZE 0, -13 ITALIC if Val( right( CodMarca, 3 ) ) > 0 if dbseek( CodMarca ) cNomeMar := alltrim( MAR_DESC ) oSay7:VarPut( cNomeMar ) oSay7:refresh() else MsgInfo( "Esta SEÇÃO/TIPO/MARCA não foi encontrado, verefique o código digitado!", "..: Atenção :.." ) select Produtos return .t. endif else cNomeMar := "Todas as Marcas" oSay7:VarPut( cNomeMar ) oSay7:refresh() endif select Produtos return .t.
  12. LEgal cara.. deu certinho... Obrigado Jhonny!
  13. Coloco isso no form principal?
  14. Amigos... tenho no meu sistema o ALT+F1 que chama um xbrowse com a listagem dos clientes.. e os devidos campos para pesquisa e tal.. eu montei esse xbrowse numa Dialog, para chamar essa Dialog com o ALT+F1, eu coloquei a opção no menu e usei o ACELETATOR MENUITEM "&1 Pesquisa de Clientes" FileName "Imagens\16\Acesso1.BMP" ACTION PesqCliente();//if( Executa( _cCodigOP, "PESQCLIENTE" ), PesqCliente(), .f. ); MESSAGE "01"; ACCELERATOR ACC_ALT, VK_F1 O que acontece é que só abre a Dialog quando estou na tela principal do sistema.. Como faço para que esta Dialog abra sobre a tela (Window) de vendas ou recebimentos?
  15. Valeu pessoal... na realidade o que era urgente, perdeu a urgencia... kkkk agora tenho que resolver outras coisas.. vou deixar isso pra depois.. Obrigado a todos..
  16. Trabalhar com DBF e MySql juntos? Não sei como abro um DBF usando a SQLLib.. Att. Everton Battiston
  17. Amigos. estou precisando de uma ideia/dica. Tenho um sistema para lojas que usa DBF, agora estou trocando para o MySql usando a SqlLib do nosso amigo Vailton. Ainda usarei os comandos do DBF. Acontece que na minha rotina de venda eu crio um arquivo temporário para que o sistema grave todos os itens vendidos nele, após o OK do caixa, quando a venda está concluída, ai gravo tudo no DBF definitivo. Com o MySql/SQLLib tem como fazer isso? Tipo, crio uma tabela, abro ela no modo exclusivo, gravo os dados dentro dela, depois mando pra tabela definitiva, e zero a temporária? Existe outra maneira mais prática de fazer a venda? Obrigado Att. Everton Battiston
  18. Valeu Emotta.. vou ver isso hj a noite.. obrigado cara!
  19. Posto a noite.. mas não uso set filter.. Só Do While Att. Everton
  20. Boa tarde amigos, estou com um problema e creio que poderão me dar uma luz.. Tenho um problema sério em relatórios na rede... quando tem mais de um usuário acessando o sistema o relatório fica lento demais.. mas quando digo demais e demais mesmo.. um relatório que sai em 30 segundos, vai para 15 minutos e alguns nem saem.. Alguém tem alguma ideia do porque ocorre e o que causa essa lentidão? Máquinas com Win7 e Servidor com o Win Server Uso Fw 6.12 e DBF! Att. Everton
  21. Eu comecei com Basic em 1988... Trabalhei numa empresa como digitador (XPC da Cobra) e o programador era de Porto Alegre. Como ficava difícil o cara vir dar manutenção ele começou e me ensinar por telefone, e as vezes por Telex ( Lembram?). Aprendi umas coisas e comecei a me interessar até que aprendi Clipper, isso em meados de 89.. Em 90 comecei a trabalhar numa empresa atacadista e ai desenvolvi meu primeiro software, que ficou terrível, mas funcionou! Comprei meu primeiro AT no Paraguai, juntava uma grana e ia comprando peça a peça.. no início usava os dois disquetes de 5,1/4 e magníficos 360Kb.. uns meses depois comprei meu HD Um Whinshester de 50Mb, os barracuda davam muito problema!..
  22. PÔ Modem US Robotics de 14400?? Não esnoba cara! o meu era 9600.. kkkkkk
  23. Mas cada lote vai ter um código em barras diferente? Não é um código por produto independente do lote? Att. Everton
×
×
  • Create New...