topic
stringlengths
1
63
text
stringlengths
1
577k
¿Cual es la última versión de AJ Make?
Resulta que estoy migrando una aplicación de FW a FWH27; y como gestor de compilación he probado AJMake, Verce y xMate. De los 3 el que más me gusta es AMake; pero la versión que tengo (0.33) genera el archivo .mak de tal forma que se genera un error durante el enlazado ("Too many MAP file names", se debe a un erroneo número de comas). Por eso, quisiera saber donde puedo conseguir una versión mejorada de AJMake o la 0.33 esla última. Además todavía se esta actualizando este programa o ya su autor lo descontinuo. Saludos desde Ecuador Fernando Espinoza
¿Cual es la última versión de AJ Make?
Hola Fernando Estoy usando tambien el AJMake y es la version 0.33 y sip, creo que por el momento el autor ha dejado de actualizarlo. ( esperemos que no ) por que es muy practica. Referente a tu error, en ningun proyecto me ha salido algo similar, seguro algun parametro le andara haciendo la gracia <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> Saludos
¿Cual es la última versión de AJ Make?
Si queres enviarme un ejemplo lo compilo usando el entorno xMate, hasta el momento, no me dio mas que satisfacciones con el FWH (x)harbour, con clipper + FW no pude.
¿Cuando usar un procedimiento en mysql?
Hola. Estoy urgando los procedimientos almacenados en mysql, y necesito una idea de donde se los utiliza mayormente. como ser, si tengo un browser que relaciona datos entre tablas, cuando se loguean usuarios, etc. Cualquier comentario al respecto vendra bien. Gracias.
¿Cuando usar un procedimiento en mysql?
No los he usado nunca pero por lo que pude entender son operaciones que se realizan desde el servidor. Por ejemplo si tengo que acreditar un cheque a una cuenta, debería descontar de la cuenta corriente el valor del cheque al emisor y sumarselo al receptor. estas operaciones normalmente se ejecutan del lado del servidor. Tengo entendido que así funcionan en las entidades bancarias. De esta manera evitarías tráfico en la red y te dan mayor seguridad. Espero te sirva.
¿Cuando usar un procedimiento en mysql?
Bien. sigamos. [quote="horacio":2ailztdk]No los he usado nunca pero por lo que pude entender son operaciones que se realizan desde el servidor. Por ejemplo si tengo que acreditar un cheque a una cuenta, debería descontar de la cuenta corriente el valor del cheque al emisor y sumarselo al receptor. estas operaciones normalmente se ejecutan del lado del servidor. Tengo entendido que así funcionan en las entidades bancarias. De esta manera evitarías tráfico en la red y te dan mayor seguridad. Espero te sirva.[/quote:2ailztdk]
¿Cuando usar un procedimiento en mysql?
Goos, Hasta ahora en mi sistema de inventarios no he necesitado de los procesos almacenados, creo que va en la forma de diseñar tus tablas y de procesos que hagas. Por ejemplo he ayudado a varios en el uso de mysql, según mi escaza experiencia, pero específicamente en el caso de los procesos almacenados resulta que hicimos uno para la creación de posiciones y vehículos, ese proceso se hacia de manera remota y se tardaba muchos segundos, era evidente el tiempo y eso daba mucho que desear en la aplicación, el proceso creaba tablas, y adicionaba las posiciones todo esto por cada horario especifico, quiere decir que era repetitivo. Bueno, con esto se creó el proceso programado y el tiempo de respuesta se redujo enormemente. Pero si te das cuenta, era un proceso que se podía hacer en proceso programado, no todo se resuelve con procesos programados, como te dije en mi caso no encuentro todavía como aplicarlo en mi sistema de inventarios. Saludos
¿Cuando usar un procedimiento en mysql?
Comprendido. En definitiva cuando se realizan consultas ya sea un select comun o join no es necesario que se lo llame a un PA (proceso almacenado)... los browser responderan en la mismo tiempo que si se realiza el select comun y corriente... A eso queria llegar. gracias. [quote="wmormar":24ad2ivb]Goos, Hasta ahora en mi sistema de inventarios no he necesitado de los procesos almacenados, creo que va en la forma de diseñar tus tablas y de procesos que hagas. Por ejemplo he ayudado a varios en el uso de mysql, según mi escaza experiencia, pero específicamente en el caso de los procesos almacenados resulta que hicimos uno para la creación de posiciones y vehículos, ese proceso se hacia de manera remota y se tardaba muchos segundos, era evidente el tiempo y eso daba mucho que desear en la aplicación, el proceso creaba tablas, y adicionaba las posiciones todo esto por cada horario especifico, quiere decir que era repetitivo. Bueno, con esto se creó el proceso programado y el tiempo de respuesta se redujo enormemente. Pero si te das cuenta, era un proceso que se podía hacer en proceso programado, no todo se resuelve con procesos programados, como te dije en mi caso no encuentro todavía como aplicarlo en mi sistema de inventarios. Saludos[/quote:24ad2ivb]
¿Cuando usar un procedimiento en mysql?
Goos, Efectivamente así es.
¿Cuál es el misterio de xHarbour?
instalado XHARBOUR en: C:\XHB1007 - mi programa FUNCIONA NORMAL. instalado XHARBOUR en: C:\XHARBOUR1303 - mi programa compila mas no FUNCIONA. instalado XHARBOUR en: XHB100713 - mi progrma FUNCIONA NORMAL. ¿Cuál es el misterio Gracias, salu2
¿Cuál es el misterio de xHarbour?
Yo tengo instalada 3 versiones en: c:\xharbour2008 c:\xharbour2006 c:\xharbour2012 Las tres funcionan sin problemas. ¿No será que en el fichero de compilación alguna dirección no la tienes correcta? Saludos
¿Cuál es el misterio de xHarbour?
[quote="Manuel Valdenebro":3ja3cizm]Yo tengo instalada 3 versiones en: c:\xharbour2008 c:\xharbour2006 c:\xharbour2012 Las tres funcionan sin problemas. ¿No será que en el fichero de compilación alguna dirección no la tienes correcta? Saludos[/quote:3ja3cizm] No Maestro, está todo correcto. Por ejemplo en el \SAMPLES del Fivewin, se indico esta ruta: XHB100713, el BUILDX.BAT indica que no encuentra esta ruta(camiño/path). Se indico: C:\XHARB1310 el BUILDX.BAT compila normal Talbéz, sea un problema con mi windows 7. Gracias, saludos.
¿Cuál es la correcta definición para MENUITEM?
Hola. Tengo un oWnd con un oMenu, si defino asi: [code=fw:2kilul9u]<div class="fw" id="{CB}" style="font-family: monospace;">     <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Guardar"</span> <span style="color: #0000ff;">ACTION</span> guardar<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />            ACCELERATOR <span style="color: #000000;">0</span>, VK_F2 ;<br />            <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Guarda los cambios"</span><br /> </div>[/code:2kilul9u] funciona de 10. Pero... Si le agrego una variable a ese menuitem oMenu y la declaro asi: [code=fw:2kilul9u]<div class="fw" id="{CB}" style="font-family: monospace;">     <span style="color: #0000ff;">MENUITEM</span> oMenu <span style="color: #0000ff;">prompt</span> <span style="color: #ff0000;">"Guardar"</span> <span style="color: #0000ff;">ACTION</span> guardar<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />            ACCELERATOR <span style="color: #000000;">0</span>, VK_F2 ;<br />            <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Guarda los cambios"</span><br /> </div>[/code:2kilul9u] la tecla aceleradora F2 deja de funcionar. Por qué pasa eso?. Necesito que tenga una variable para luego podes deshabilitarlo (a no ser que exista otra forma. Gracias.
¿Cuál es la correcta definición para MENUITEM?
[code=fw:2iwyj3sj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"FiveWin.Ch"</span><br /><br /><span style="color: #00C800;">STATIC</span> oWnd<br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing PullDown Menus"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MDI</span> MENUINFO <span style="color: #000000;">2</span><br /><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">oMenu</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">Resize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oMenu, oMenu1, oMenu2, oMenu3<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMenu<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> oMenu1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Guardar - <F2> "</span> &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> guardar<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ACCELERATOR <span style="color: #000000;">0</span>, VK_F2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Guarda los cambios"</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> Omenu2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Clientes - <F5> "</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENU</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> oMenu2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Clientes - <F5> "</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> Clientes<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ACCELERATOR <span style="color: #000000;">0</span>, VK_F5 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Guardar Clientes"</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDMENU</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> oMenu3 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Salida <Alt+S> "</span> &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">&#40;</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Salida"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">SetMenu</span><span style="color: #000000;">&#40;</span> oMenu <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">FUNCTION</span> guardar<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;? <span style="color: #000000;">&#91;</span>GUARDAR<span style="color: #000000;">&#93;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">Function</span> Clientes<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;? <span style="color: #000000;">&#91;</span>Clientes<span style="color: #000000;">&#93;</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">// END OF PROGRAM</span><br />&nbsp;</div>[/code:2iwyj3sj] 
¿Cuál es la correcta definición para MENUITEM?
Karina, Es el mismo codigo que pruebo, y en mi versión no funciona. gracias.
¿Cuál es la correcta definición para MENUITEM?
Gustavo, Aqui funciona bien con FWH 14.08 que versión de FWH usas ?
¿Cuál es la correcta definición para MENUITEM?
[quote="Antonio Linares":yaa52ahq]Gustavo, Aqui funciona bien con FWH 14.08 que versión de FWH usas ?[/quote:yaa52ahq] 7.1 media vieja es.
¿Cuál es la correcta definición para MENUITEM?
Funciona perfecto con FWH2.7 - November 2005 [code=fw:3rxj9zh1]<div class="fw" id="{CB}" style="font-family: monospace;"><br />+----------------------------------------------------------------------------+<br />¦ FiveWin <span style="color: #00C800;">for</span> xHarbour <span style="color: #000000;">2.7</span> - November <span style="color: #000000;">2005</span> &nbsp; &nbsp; &nbsp; &nbsp;xHarbour development <span style="color: #0000ff;">power</span> ¦_<br />¦ <span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span> FiveTech, <span style="color: #000000;">1993</span><span style="color: #000000;">-2005</span> &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> Microsoft Windows <span style="color: #000000;">95</span>/<span style="color: #000000;">98</span>/NT/<span style="color: #000000;">2000</span>/ME and XP ¦¦<br />+----------------------------------------------------------------------------+¦<br />  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯<br />Compiling...<br />xHarbour Compiler build <span style="color: #000000;">0.99</span><span style="color: #000000;">.61</span> <span style="color: #000000;">&#40;</span>SimpLex<span style="color: #000000;">&#41;</span><br />Copyright <span style="color: #000000;">1999</span><span style="color: #000000;">-2006</span>, http:<span style="color: #B900B9;">//www.xharbour.org <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m --></span><br />Compiling <span style="color: #ff0000;">'teste3.prg'</span> and generating preprocessed output <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">'teste3.ppo'</span>...<br />Lines <span style="color: #000000;">65</span>, Functions/Procedures <span style="color: #000000;">4</span><br />Generating C source output <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">'teste3.c'</span>...<br />Done.<br />Borland C++ <span style="color: #000000;">5.5</span><span style="color: #000000;">.1</span> <span style="color: #00C800;">for</span> Win32 Copyright <span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span> <span style="color: #000000;">1993</span>, <span style="color: #000000;">2000</span> Borland<br />teste3.c:<br /><span style="color: #000000;">Turbo</span> Incremental Link <span style="color: #000000;">5.00</span> Copyright <span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span> <span style="color: #000000;">1997</span>, <span style="color: #000000;">2000</span> Borland<br />Não foi possível encontrar C:\FWH27\SAMPLES\teste3.il?<br />* Application successfully built<br />C:\FWH27\SAMPLES><br />&nbsp;</div>[/code:3rxj9zh1] Saludos. Usas Pantallas MDI?
¿Cuál es la correcta definición para MENUITEM?
No. Nada, es mas lo unico que hice fue poner un window y un menu para probar.
¿Cuál es la correcta definición para MENUITEM?
verifique y cuando pongo menu ::omenu 2007 esa es la diferencia, si pongo eso no funciona.
¿Cuál es la correcta definición para MENUITEM?
[url:38vw7rri]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=28745&p=161305&hilit=ACCELERATOR+no+funciona#p161305[/url:38vw7rri] tu versión de FWH és antigua Actualize su versión de FWH para una más reciente. Salu2.
¿Cóm se ordena un array?
Tengo el siguiente código que me ordena por el primer elemento, luego por el segundo. aResumen := ASort( aResumen, , , { | x, y | If( x[1] < y[1], .T., If( x[1] == y[1], x[2] < y[2], FALSE ) ) } ) Pero no he conseguido ordenar por el tercer elemento Saludos Fernando Leal México, DF
¿Cóm se ordena un array?
Fernando: Que tipo de informacion contiene el array, valores simples o son arrays anidados ?. Saludos,
¿Cóm se ordena un array?
Contiene valores simples. Gracias Fernando Leal
¿Cóm se ordena un array?
Fernando: Si contiene valores simples no necesitas pasarle el criterio de ordenacion como parametro por cada uno de los elementos. Con poner: aMatriz := { 3, 5, 1, 2, 4 } ASORT(aMatriz) //Resultado: { 1, 2, 3, 4, 5 } ASORT(aMatriz,,, { |x, y| x > y }) //Resultado: { 5, 4, 3, 2, 1 } Es suficiente, fijate en las NG. Saludos,
¿Cóm se ordena un array?
Daniel, Perdona... es así como se contruye el array. while HISTORIA->( !eof() ) AADD( aResumen,{ HISTORIA->CLAVE_VERI, HISTORIA->CPRODUCTO, HISTORIA->ID_VERIF, HISTORIA->ID_ZONA, 1 } ) HISTORIA->( DbSkip() ) enddo Como ves, recorro la HISTORIA.DBF y voy agregando al array 4 campos y el al quinto solo le pongo el número 1 Pues, necesito ordenar por CLAVE_VERI despues por CPRODUCTO hasta aquí no tengo problemas, pero no he podido subordernar por ID_VERIF Y ID_ZONA Saludos Fernando
¿Cóm se ordena un array?
Fernando: aResumen:=ASORT(aResumen,,,{ |x,y| x[1]+x[2]+x[3]+x[4] < y[1]+y[2]+y[3]+y[4] } ) Saludos,
¿Cóm se ordena un array?
Funciona bien, gracias Saludos Fernando Leal México, DF
¿Cómo activo el botón XLS del Preview?
Estimados Buenas noches, ¿Cómo activo el botón XLS del Preview? el de PDF y de WORD están activados y funcionan bien pero este sale "disabled". Ya me he revisado varios prg´s inclusive FIVEDBU y no lo encontre (a propósito no permite imprimir la estructura de una tabla y tampoco modificarla, se podría implementar. Saludos ) Muchas gracias desde ya. Waldemar
¿Cómo activo el botón XLS del Preview?
If you are generating a preview of a report with code like this: [code=fw:7a780r8s]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #00C800;">local</span> oRep, oFont, oBold, oCol<br /><br />&nbsp; &nbsp;USE CUSTOMER <span style="color: #00C800;">NEW</span> SHARED<br />&nbsp; &nbsp;SET FILTER <span style="color: #0000ff;">TO</span> RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <= <span style="color: #000000;">20</span><br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br />&nbsp; &nbsp;REPORT oRep PREVIEW <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp;COLUMN oCol <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"NAME"</span> <span style="color: #00C800;">DATA</span> FIELD->FIRST<br />&nbsp; &nbsp;COLUMN oCol <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"CITY"</span> <span style="color: #00C800;">DATA</span> FIELD->CITY<br /><br />&nbsp; &nbsp;ENDREPORT<br /><br />&nbsp; &nbsp;oRep:<span style="color: #000000;">bInit</span> := <span style="color: #000000;">&#123;</span> || CUSTOMER-><span style="color: #000000;">&#40;</span> DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> REPORT oRep<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br />&nbsp;</div>[/code:7a780r8s] Please insert this code after ENDREPORT and ACTIVATE REPORT [code=fw:7a780r8s]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;oRep:<span style="color: #000000;">bInit</span> := <span style="color: #000000;">&#123;</span> || CUSTOMER-><span style="color: #000000;">&#40;</span> DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:7a780r8s] Then, the Excel button of preivew works. Without this, the preview does not work.
¿Cómo activo el botón XLS del Preview?
Dir Rao I did what you said me. The sample: Function ImpBoletas(cRut,cSocio) Local oLis Boletas->(DBGoTop()) REPORT oLis TITLE "BOLETAS DE "+cSocio,"","RUT "+cRut; HEADER "SINDICATO",; "Fecha: "+Dtoc(Date()),; "Hora : "+Time() LEFT ; FOOTER "Pag "+Str(oLis:nPage,3) CENTERED; CAPTION "Boletas"; PREVIEW COLUMN TITLE "FECHA" DATA Boletas->FECHA COLUMN TITLE "Nº BOLETA" DATA Boletas->NUM_BOL COLUMN TITLE "DETALLE" DATA Boletas->DETALLE COLUMN TITLE "VALOR" DATA Boletas->VALOR; PICTURE "@E 99,999,999"; RIGHT TOTAL END REPORT oLis:bInit := { || Boletas->( DBGOTOP() ) } ACTIVATE REPORT oLis //Boletas->(DBGoTop()) Return(NIL) But don´t work, the bottom excel on the preview is disable yet. I do someting bad? Thank for your help Waldemar
¿Cómo activo el botón XLS del Preview?
What version of FWH you are using?
¿Cómo activo el botón XLS del Preview?
Drae Mr. Rao My version is FWH 1903, and use pellesC Best regards Waldemar
¿Cómo activo el botón XLS del Preview?
Then it should work. Try clicking on excel button. Just now this is the program I tested : You may copy this program to \fwh\samples folder and run with buildh.bat or buildx.bat Please make sure that you are not using any modifications to the fwh libraray. [code=fw:1pbpt90l]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"report.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">local</span> oRep, oFont<br /><br />   USE CUSTOMER <span style="color: #00C800;">NEW</span> SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br />   SET FILTER <span style="color: #0000ff;">TO</span> RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <= <span style="color: #000000;">20</span><br />   GO TOP<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br />   REPORT oRep PREVIEW <span style="color: #0000ff;">FONT</span> oFont<br /><br />   COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"NAME"</span> <span style="color: #00C800;">DATA</span> FIELD->FIRST<br />   COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"CITY"</span> <span style="color: #00C800;">DATA</span> FIELD->CITY<br /><br />   ENDREPORT<br /><br />   oRep:<span style="color: #000000;">bInit</span> := <span style="color: #000000;">&#123;</span> || CUSTOMER-><span style="color: #000000;">&#40;</span> DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> REPORT oRep<br /><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:1pbpt90l] This is the result: [url=https&#58;//imageshack&#46;com/i/pm7uLMo1g:1pbpt90l][img:1pbpt90l]https&#58;//imagizer&#46;imageshack&#46;com/img922/9026/7uLMo1&#46;gif[/img:1pbpt90l][/url:1pbpt90l]
¿Cómo activo el botón XLS del Preview?
Dear Rao I´ve compiled and linked several examples like FiveDbu and the butttom excel preview works for that i beleave i have to acive some of clase xbrowse or of preiew, what do you thing? Best Regards Waldemar i use bcc7.
¿Cómo activo el botón XLS del Preview?
Are you using any modified report.prg or modified rpreview.prg?
¿Cómo activo el botón XLS del Preview?
Dear Rao No i did, but my prg (the main) i did not begin of zero I modified a old one (FWXH 13 i guest?), maybe that it is de problem. i've seen a lot prg's and in all cases the object is related to DATA bExcel. example: oBrw:toExcel(parameters, I don´t know) My problem is i need work with the classe in "report" and from preview my email is <!-- e --><a href="mailto:waldemar@easycomp.cl">waldemar@easycomp.cl</a><!-- e --> thank you very much Waldemar González
¿Cómo activo el botón XLS del Preview?
1) You can call oBrw:ToExcel() without any parameters. 2) Export to Excel works from Preview of Report class. 3) I posted a sample above. Please copy the sample to \fwh\samples folder and build it with buildx.bat Is this sample working for you correctly as expected?
¿Cómo activo el botón XLS del Preview?
[quote="nageswaragunupudi":3yt9p3wl]1) You can call oBrw:ToExcel() without any parameters. 2) Export to Excel works from Preview of Report class. 3) I posted a sample above. Please copy the sample to \fwh\samples folder and build it with buildx.bat Is this sample working for you correctly as expected?[/quote:3yt9p3wl] Dear Rao 1) I know that but i need more control about oBrw:ToExcel(). 2) To me doesn´t work from Preview. I get 2 function`s give reports with preview and the excel buttom is Disabled. 3) I did and It works very well but when I call from may program it doesn' works. my function: Function ImpBoletas(cRut,cSocio) Local oLis //cBuscar:=Ctaarr->(Fieldget(3))+Str(Ctaarr->(Fieldget(6)),2)+Str(Ctaarr->(Fieldget(7)),4) Boletas->(DBGoTop()) REPORT oLis TITLE "BOLETAS DE "+cSocio,"","RUT "+cRut; HEADER "SINDICATO DE TRABAJADORES HONORARIOS",; "Fecha: "+Dtoc(Date()),; "Hora : "+Time() LEFT ; FOOTER "Pag "+Str(oLis:nPage,3) CENTERED; CAPTION "Boletas de Medicamentos"; PREVIEW COLUMN TITLE "FECHA" DATA Boletas->FECHA COLUMN TITLE "Nº BOLETA" DATA Boletas->NUM_BOL COLUMN TITLE "DETALLE" DATA Boletas->DETALLE COLUMN TITLE "VALOR" DATA Boletas->VALOR; PICTURE "@E 99,999,999"; RIGHT TOTAL END REPORT oLis:bInit := { || Boletas->( DBGOTOP() ) } ACTIVATE REPORT oLis //Boletas->(DBGoTop()) Return(NIL) Thanks Best Regards Waldemar
¿Cómo cambiar index con tsbrowse?
Hola amigos del foro, nuevamente me acerco a ustedes a ver si me pueden ayudar un poco. Tengo una tabla con 5 indices, y necesito alternarlos pinchando el "Header" del campo en una TSBrowse... A quien me pueda ayudar en este tema, le estaré muy agradecido.
¿Cómo cambiar index con tsbrowse?
Hola León: [quote="Leon Valenzuela":3cdl5hcl]Tengo una tabla con 5 indices, y necesito alternarlos pinchando el "Header" del campo en una TSBrowse...[/quote:3cdl5hcl] Al definir las columnas cuyos datos controlan los índices, usa la cláusula ORDER <cNombre_del_indice>. Ejemplo: ADD COLUMN TO oBrw DATA MiDbf'->Codigo TITLE "Código" ORDER "Codigo" ADD COLUMN TO oBrw DATA MiDbf'->Nombre TITLE "Nombre" ORDER "Nombre" Un abrazo. Manuel Mercado
¿Cómo cambiar index con tsbrowse?
Manuel, usted como siempre no me defrauda, muchas gracias MAESTRO. Un Abrazo.
¿Cómo cambiar index con tsbrowse?
Con un sólo index me resultó bien, pero cuando agregué más indices, me arroja el siguiente error... [code=fw:1812iv2c]<div class="fw" id="{CB}" style="font-family: monospace;">===========<br />&nbsp; &nbsp;Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">D</span>:\FWH\Bakery\WCCCLi.exe <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">Size</span>: <span style="color: #000000;">4</span>,<span style="color: #000000;">329</span>,<span style="color: #000000;">984</span> bytes<br />&nbsp; &nbsp;Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">4</span> mins <span style="color: #000000;">4</span> secs <br />&nbsp; &nbsp;Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">04</span>/<span style="color: #000000;">08</span>/<span style="color: #000000;">2009</span>, <span style="color: #000000;">19</span>:<span style="color: #000000;">28</span>:<span style="color: #000000;">34</span><br />&nbsp; &nbsp;Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1132</span> &nbsp;Bound error: <span style="color: #000000;">array</span> access<br />&nbsp; &nbsp;Args:<br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> &nbsp; <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = A &nbsp; <span style="color: #000000;">&#123;</span> ... <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span> &nbsp; <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = N &nbsp; <span style="color: #000000;">9</span><br /><br />Stack Calls<br />===========<br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TSBROWSE:<span style="color: #000000;">GOEND</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">4687</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TSBROWSE:<span style="color: #000000;">KEYDOWN</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">5670</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TSBROWSE:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">6412</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> DIALOGBOX<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: .\CTACLI.PRG => CTA_CTE<span style="color: #000000;">&#40;</span><span style="color: #000000;">347</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: .\CTACLI.PRG => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>SELECCTION<span style="color: #000000;">&#40;</span><span style="color: #000000;">216</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TSBROWSE:<span style="color: #000000;">LDBLCLICK</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">6154</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TSBROWSE:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">6412</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> WINRUN<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: &nbsp;=> TMDIFRAME:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Called <span style="color: #0000ff;">from</span>: .\WCCCLI.PRG => MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">519</span><span style="color: #000000;">&#41;</span></div>[/code:1812iv2c] Por qué?, no lo sé...
¿Cómo colocar en xBrowse el ticket para campos lógicos?
Estimados. Ya revise todos los ejemplos (los que encontré) y no he podido ver el código donde se hace esto en Xbrowse y yampoco los bitmaps. Muchas Gracias desde Ya.
¿Cómo colocar en xBrowse el ticket para campos lógicos?
yo lo utilizo de esta forma: [code=fw:2zz1h0cd]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//-- Folder 3-1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> &nbsp;<span style="color: #0000ff;">XBROWSE</span> &nbsp;oBrw<span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> &nbsp;<span style="color: #000000;">21</span> COLUMNS <span style="color: #ff0000;">"ASIG"</span>,<span style="color: #ff0000;">"CODI"</span>,<span style="color: #ff0000;">"NOMB"</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"SI16"</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">FONT</span> xFont NOBORDER AUTOSORT FOOTERS<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp; := <span style="color: #ff0000;">"Estado"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; &nbsp;oBrw<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span> &nbsp; &nbsp; &nbsp; &nbsp;:= &nbsp;<span style="color: #000000;">50</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp; := <span style="color: #ff0000;">"Código"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; &nbsp;oBrw<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span> &nbsp; &nbsp; &nbsp; &nbsp;:= &nbsp;<span style="color: #000000;">60</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp; := <span style="color: #ff0000;">"Nombre de Bodega"</span> &nbsp; ; &nbsp;oBrw<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">320</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nHeaderLines</span> &nbsp; &nbsp; &nbsp; &nbsp;:= &nbsp;<span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Estado</span>:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> FWBmpOn<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, FWBmpOff<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, EDIT_GET <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//--</span><br /><br />&nbsp;</div>[/code:2zz1h0cd] FWBmpOn(), FWBmpOff() son los bitmap por defecto de Fivewin, puedes reemplazarlos por los que usas personalmente, ya sea por recursos o ficheros fijate en oBrw[5]:Estado:SetCheck(...), correponde al nombre del Header de la columna del campo lógico "ASIG" de la dbf de paso Saludos
¿Cómo colocar en xBrowse el ticket para campos lógicos?
Estimado Armando OK, Voy a probarlo, muchas gracias. Saludos de Colbún - Maule - Chile
¿Cómo colocar en xBrowse el ticket para campos lógicos?
Estimados, No me funciona Aquí mi código @ 0,0 XBROWSE oBrwPen; FIELDS if(Pend->MARCA,Tic,Bla),; Dtoc(Pend->FECHA),Pend->CORR,; Pend->DETALLE,; Transform(Pend->VALOR,"@E 99,999,999"); HEADERS "M","FECHA","CORRELATIVO","DETALLE","VALOR"; ON DBLCLICK ( Marca(PEND),oBrwPen:DrawSelect() ); FONT oLetra oBrwPen:nMarqueeStyle := MARQSTYLE_HIGHLROW oBrwPen:M:SetCheck( , .t. ) oBrwPen:CreateFromCode() oVenChPen:oClient:=oBrwPen oVenChPen:bPostEnd := { || ( aNomBas[PEND] )->( DBCLOSEAREA() ) } ACTIVATE WINDOW oVenChPen; ON INIT ( oVenChPen:SetFocus() ); VALID( alBases[PEND]:=.F.,.T. ) Desde ya muchas gracias
¿Cómo controlar click al querer pasar a otro campo?
tengo 2 get, quiero controlar que estando en el get 1 y querer pasar al get 2 utilizando el mouse me detecte si en el get 1 se ingreso algun dato.ya lo hice utilizando el teclado pero no se como carptar el click del mouse.Gracias.
¿Cómo controlar click al querer pasar a otro campo?
redefine oget1 var ctes1 id 4001 of odlgredefine oget2 var ctes2 id 4002 of odlg when if(empty(ctes1),.f.,.t.)talvez utilizando oget2:blostfocus:={||}oget2:bgotfocus:={||}
¿Cómo controlar click al querer pasar a otro campo?
En realidad no pude antes, pero ahora esta funcionando asi:[code:2l7rqzwc] &#58;&#58;oDatos&#91;1&#93;&#58;bValid&#58;=&#123;|| &#58;&#58;controlarPulsaciones&#40; &#58;&#58;oDatos&#91;1&#93;&#58;nLastKey &#41; &#125; [/code:2l7rqzwc][quote="SGS":2l7rqzwc]redefine oget1 var ctes1 id 4001 of odlg redefine oget2 var ctes2 id 4002 of odlg when if(empty(ctes1),.f.,.t.) talvez utilizando oget2:blostfocus:={||} oget2:bgotfocus:={||}[/quote:2l7rqzwc]
¿Cómo controlo la activacion/desactivacion del checkbox?
Hola. Quiero controlar cuando se cambia el estado de un checkbox, cosa de solo ponerlo en .T. si se aprueba una condicion... [code=fw:llkoxj3d]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>condicion<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;poner en .T. el <span style="color: #0000ff;">checkbox</span><br /><span style="color: #00C800;">endif</span></div>[/code:llkoxj3d] Gracias.
¿Cómo controlo la activacion/desactivacion del checkbox?
Hola amigo... Prueba lo siguiente: [code=fw:2tebtwkn]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">CHECKBOX</span> oChk <span style="color: #0000ff;">VAR</span> vChk <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg1<br /> </div>[/code:2tebtwkn] [code=fw:2tebtwkn]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">IF</span> Condicion<br />   vChk:=.t.<br />   oChk:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /> </div>[/code:2tebtwkn] Espero te sirva. Saludos,
¿Cómo controlo la activacion/desactivacion del checkbox?
Gracias por la contestacion, pero la idea es poder VALIDAR ese checkbox, en que metodo del checkbox se lo pone? porque cuando quiero probar hasta con on click no lo puedo controlar. solamente va y lo pone en .t. o en su defecto .f. Gracias. [quote="jrestojeda":2x7xalft]Hola amigo... Prueba lo siguiente: [code=fw:2x7xalft]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">CHECKBOX</span> oChk <span style="color: #0000ff;">VAR</span> vChk <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg1<br /> </div>[/code:2x7xalft] [code=fw:2x7xalft]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">IF</span> Condicion<br />   vChk:=.t.<br />   oChk:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /> </div>[/code:2x7xalft] Espero te sirva. Saludos,[/quote:2x7xalft]
¿Cómo controlo la activacion/desactivacion del checkbox?
Ok... Pero la función que lo valide... no depende del CheckBox dependerá de la condición a cumplir. Que se tiene que cumplir para activar o desactivar el Check??? Lei que hablabas de una condición a cumplirse... Bueno la idea sería saber cuando cambia esa condición y hay crear una función muy pequeña que valide el Check y llamarla cuando esta condición cambie. Quizá si pones un poco de código sea más sencillo entender. Saludos,
¿Cómo controlo la activacion/desactivacion del checkbox?
Por que no lo validas con la clausula when ? ejemplo : mCordoba = .f. mDolar = .f. REDEFINE CHECKBOX oCordoba Var mCordoba ID 101 of oDlg When !mDolar ( Valido cuando no es dolares ) REDEFINE CHECKBOX oDolar Var mDolar ID 102 of oDlg When !mCordoba ( Valido cuando no es Cordobas ) ojala te sirva Saludes desde Managua, Nicaragua Ramon Paredes
¿Cómo controlo la activacion/desactivacion del checkbox?
Gracias a todos. Esta del when se adapto a lo que necesitaba. Gracias. [quote="Ramon Paredes":256tx13x]Por que no lo validas con la clausula when ? ejemplo : mCordoba = .f. mDolar = .f. REDEFINE CHECKBOX oCordoba Var mCordoba ID 101 of oDlg When !mDolar ( Valido cuando no es dolares ) REDEFINE CHECKBOX oDolar Var mDolar ID 102 of oDlg When !mCordoba ( Valido cuando no es Cordobas ) ojala te sirva Saludes desde Managua, Nicaragua Ramon Paredes[/quote:256tx13x]
¿Cómo controlo la activacion/desactivacion del checkbox?
Hola amigo... Ahora que veo tu solución me doy cuenta que quizá te hubiese sido conveniente usar otro control, no los Check. Creo que para lo que estás validando ahi el control correcto a utilizar es el RADIO que ya tiene esa validación de manera automática. Es solo una sugerencia. Saludos,
¿Cómo controlo la activacion/desactivacion del checkbox?
Sabes q si, ya lo estoy implementando. Gustavo. [quote="jrestojeda":3hdrsjgk]Hola amigo... Ahora que veo tu solución me doy cuenta que quizá te hubiese sido conveniente usar otro control, no los Check. Creo que para lo que estás validando ahi el control correcto a utilizar es el RADIO que ya tiene esa validación de manera automática. Es solo una sugerencia. Saludos,[/quote:3hdrsjgk]
¿Cómo defino esto como bloque?
hola. Tengo una idea dando vueltas, necesito pasar en un array 3 parametros compuesto por: [quote:2zl158vj]un numero: 4, una conficion: if(::oDato:fields(2):value==2) un valor de color: "#D9DFF0" [/quote:2zl158vj] para luego analizar esa "condición"(segundo parametro) y dependiendo de el resultado ponerle un color. Lo que no logro hacer es poder pasar la condicion y luego utilizarla. [code=fw:2zl158vj]<div class="fw" id="{CB}" style="font-family: monospace;">aArray:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">4</span>, || <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDato</span>:<span style="color: #000000;">fields</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>==<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span> ,<span style="color: #ff0000;">"#D9DFF0"</span> <span style="color: #000000;">&#125;</span></div>[/code:2zl158vj] gracias
¿Cómo defino esto como bloque?
Amigo, Ignoro que significa el "4" (parecería que es primer elemento en un arreglo que quieres usar después en "algo"), pero si lo que deseas es evaluar la condición, y en base al resultado retornar el color, seria algo asi: array := {4, if(condicion, color,)} Y creo que para evaluarla podrias usar AEVAL(). Fijate en los ejemplos de xHarbour, y alli te puedes ayudar. Suerte (si te interpreté bien),
¿Cómo defino esto como bloque?
Si la funcion a donde la pasar es un metodo conocera ::oDato , sino deberas pasar la referencia a la clase [code=fw:1miot211]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">local</span> bcondicion:= <span style="color: #000000;">&#123;</span>|o | &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>o:<span style="color: #000000;">oDato</span>:<span style="color: #000000;">fields</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>==<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br /><span style="color: #00C800;">local</span> aArray:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">4</span>, bcondicion , <span style="color: #00C800;">self</span> ,<span style="color: #ff0000;">"#D9DFF0"</span> <span style="color: #000000;">&#125;</span><br />recibe<span style="color: #000000;">&#40;</span>aArray<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">function</span> recibe<span style="color: #000000;">&#40;</span>aArray<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> bcondicion:=aArray<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">local</span> o:=aArray<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">if</span> eval<span style="color: #000000;">&#40;</span>bcondicion,o <span style="color: #000000;">&#41;</span><br />&nbsp; ...<br /><span style="color: #00C800;">else</span><br />...<br /><span style="color: #00C800;">endif</span><br /><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br />&nbsp;</div>[/code:1miot211] Aunque yo evaluaria la condicon antes de pasarla y pasaría el resultado ... [code=fw:1miot211]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">local</span> lcondicion:= &nbsp;Iif <span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oDato</span>:<span style="color: #000000;">fields</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>==<span style="color: #000000;">2</span>, .t. ,.f.<span style="color: #000000;">&#41;</span> &nbsp;<br /><span style="color: #00C800;">local</span> aArray:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">4</span>, lcondicion , <span style="color: #ff0000;">"#D9DFF0"</span> <span style="color: #000000;">&#125;</span><br />recibe<span style="color: #000000;">&#40;</span>aArray<span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #00C800;">function</span> recibe<span style="color: #000000;">&#40;</span>aArray<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">if</span> aArray<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />&nbsp; ...<br /><span style="color: #00C800;">else</span><br />...<br /><span style="color: #00C800;">endif</span><br /><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br />&nbsp;</div>[/code:1miot211]
¿Cómo defino esto como bloque?
Gracias a ambos. Pero tomando este ejemplo paso a explicarme mejor. El array aArray puede o no contener mas de un arreglo del que mensionaba. A ver... aArray:= { {1, "saldo=2", "#001225"}, {10, "cliente=2", "#000025"}, } quiero que luego poder desglozar esas dos condiciones. ya que "saldo" y "cliente" son variables. [code=fw:30nnt47e]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">for</span> nitem:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">5</span><br />   <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>aArray<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = nItem<span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> ACA QUIERO HACER QUE PREGUNTE POR LA CONDICION<span style="color: #B900B9;">///// </span><br />        PINTAR DEL <span style="color: #0000ff;">COLOR</span> aArray<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />     <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">next</span> <br /> </div>[/code:30nnt47e] Me explique mejor?
¿Cómo defino esto como bloque?
pasa el array asi : [code=fw:31m9xe1y]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aArray:= <span style="color: #000000;">&#123;</span><br /><span style="color: #000000;">&#123;</span><span style="color: #000000;">1</span>, &nbsp;<span style="color: #000000;">&#123;</span>||saldo=<span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>, <span style="color: #ff0000;">"#001225"</span><span style="color: #000000;">&#125;</span>,<br /><span style="color: #000000;">&#123;</span><span style="color: #000000;">10</span>,<span style="color: #000000;">&#123;</span>|| cliente=<span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>, <span style="color: #ff0000;">"#000025"</span><span style="color: #000000;">&#125;</span>,<br /><span style="color: #000000;">&#125;</span><br /><br />&nbsp;</div>[/code:31m9xe1y] y luego evalualo: [code=fw:31m9xe1y]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">for</span> nitem:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">5</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>aArray<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = nItem<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> eval<span style="color: #000000;">&#40;</span>aArray<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; PINTAR DEL <span style="color: #0000ff;">COLOR</span> aArray<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp;</div>[/code:31m9xe1y]
¿Cómo defino esto como bloque?
Creo que seria asi: [code=fw:2a8zglum]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">for</span> nitem:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">5</span><br />   <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>aArray<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = nItem<span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> &<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"("</span>+aArray<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>+<span style="color: #ff0000;">")"</span><span style="color: #000000;">&#41;</span> <br />        PINTAR DEL <span style="color: #0000ff;">COLOR</span> aArray<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />     <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">next</span> <br /> </div>[/code:2a8zglum] Lo que ocurre es que la condicion debe ser testeada en tiempo real (no se puede evaluar antes), ese elemento del aArray esta en string, por lo cual debes utlizar el macro (&()) de la expresion, que seria, por ejemplo "(cliente==2)" Suerte,
¿Cómo defino esto como bloque?
Entendi lo que me explicas pero en mi codigo no me anda. [code=fw:3vikwcpa]<div class="fw" id="{CB}" style="font-family: monospace;">Ejmplo:<br /><br />:<span style="color: #000000;">aColorear</span> &nbsp; := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">4</span>,<span style="color: #ff0000;">"nItem==1"</span>,<span style="color: #ff0000;">"#001225"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br />...<br /><br /><span style="color: #00C800;">FOR</span> nItem:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> Len<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">aColumna</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> &<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"("</span>+::<span style="color: #000000;">aColorear</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>+<span style="color: #ff0000;">")"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// cuando lo ejecuto me dice NITEM no definido... es por eso que no lo entiendo.</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// nitem esta definido.</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">next</span> nITem<br />&nbsp;</div>[/code:3vikwcpa]
¿Cómo defino esto como bloque?
El mensaje de error que dices aquí tiene que ver con otra cosa (definición de variables). Busca por otro lado. Yo haría debug paso-a-paso, a ver que está pasando con nItem (antes, durante y despues del bucle). Suerte,
¿Cómo defino esto como bloque?
Hola amigo... Prueba algo así: AADD(aArray ,{ n1 , lCondicion1 , Color1 } ) AADD(aArray ,{ n2 , lCondicion2 , Color2 } ) AADD(aArray ,{ n3 , lCondicion3 , Color3 } ) [code=fw:6z0b4ijn]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">for</span> nitem:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">3</span><br />&nbsp;  <span style="color: #00C800;">if</span> aArray<span style="color: #000000;">&#91;</span>nItem<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />&nbsp;    PINTAR DEL <span style="color: #0000ff;">COLOR</span> aArray<span style="color: #000000;">&#91;</span>nItem<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />&nbsp; <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">next</span></div>[/code:6z0b4ijn] Espero te sirva.
¿Cómo defino esto como bloque?
Goosfancito Esta bien que te genere ese error, un code block es un proceso que se ejecuta en un area de memoria distinta a la funcion actual, donde maneja sus propias variables, a menos que declares nItem como publica no tendras acceso a su valor, realmente nItem no existe dentro de ese proceso (code block) Cambiando un poco la idea de Julio podria usarse algo asi [code=fw:wngc52bt]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> aArray := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">4</span>, <span style="color: #ff0000;">"nItem==1"</span>, <span style="color: #ff0000;">"#001225"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />   Bloque<span style="color: #000000;">&#40;</span> aArray <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Bloque<span style="color: #000000;">&#40;</span> aArray <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> nItem<br />   <span style="color: #00C800;">local</span> cBloque<br />   <br />   <span style="color: #00C800;">FOR</span> nItem:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> Len<span style="color: #000000;">&#40;</span> aArray <span style="color: #000000;">&#41;</span><br />      cBloque = <span style="color: #ff0000;">"{| nItem | "</span> + aArray<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">"}"</span><br />      <span style="color: #00C800;">IF</span> Eval<span style="color: #000000;">&#40;</span> &cBloque, nItem <span style="color: #000000;">&#41;</span><br />         ? <span style="color: #ff0000;">"PASO"</span>   <br />      <span style="color: #00C800;">ENDIF</span><br />   <span style="color: #00C800;">next</span> nITem<br />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:wngc52bt]
¿Cómo defino esto como bloque?
voy a tener que ver otra forma entonces. porque nItem lo utilice como ejemplo, pero la realidad es que esos campos van a ser o de un RecordSet o de alguna otra variable que podr'ia ser como nItem. gracias.
¿Cómo defino esto como bloque?
... Ok pasalo como parametro al codeblock al momento de evaluarlo, mira el ejemplo que te expuse
¿Cómo detecto cuando se oprime Alt+Letra?
Hola Foro, Tengo un dialogo con varios gets... quiero saber en un momento dado si alguien oprime por ejemplo Alt+E Gracias Fernando
¿Cómo detecto cuando se oprime Alt+Letra?
[code:w7pm0jyg] SETKEY&#40; ASC&#40;"V"&#41; , &#123;|| if&#40;GetKeyState&#40; VK_CONTROL &#41; ,"ACA DETECTO",&#41;&#125;&#41; [/code:w7pm0jyg]
¿Cómo detecto cuando se oprime Alt+Letra?
Hola Gustavo, ¿Cómo se usa?. Lo he puesto al inicio de la función pero cuando estoy en el get me pega el código en el get <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> Gracias
¿Cómo enviar a Excel reporte con TPrinter?
Hola amigos del foro. Es eso. Utilizo mucho la clase TPrinter para mis reportes y necesito enviarlos a Excel. ¿Alguno de ustedes puede orientarme, o falicilitarme un pequeño ejemplo? Gracias.
¿Cómo enviar a Excel reporte con TPrinter?
Francisco, Por que no utilizas Filexls puedes usarla con coordenadas y operaciones matematicas y rompimientos de control y todo lo demas Saludes Ramon Paredes
¿Cómo enviar a Excel reporte con TPrinter?
Francisco: Un pequeño ejemplo del uso de filexls SELECT A USE RGEN1 PUBLIC oFileXLS,oDlg, oLbx, oFont, oMeter, nMeter,oExcel, oHoja, oBrw DEFINE FONT oFont NAME "Arial" SIZE 0,-11 PUBLIC lIni := .t., nReg := RecNo(), cActividad := "" PUBLIC nFormat1, nFormat2,nContar,nContar1 PUBLIC nFont1, nFont2, nFont3, nFont4 nContar = 0 nContar1 = 0 PUBLIC aRowActividad := {} PUBLIC cSuma1 := "", cSuma2 := "" ,cSuma3 := "", cSuma4 := "",cSuma5 := "" PUBLIC cSuma6 := "", cSuma7 := "" ,cSuma8 := "", cSuma9 := "",cSuma10 := "" PUBLIC cSuma11 := "", cSuma12 := "" ,cSuma13 := "", cSuma14 := "",cSuma15 := "" PUBLIC cSuma16 := "" PUBLIC nRow, nRowActividad oExcel := TOleAuto():New( "Excel.Application" ) oHoja := oExcel:Get( "ActiveSheet" ) DEFINE XLS FORMAT nFormat1 PICTURE '#,##0' // para pesetas DEFINE XLS FORMAT nFormat2 PICTURE '#,##0.00' // para euros DEFINE XLS FONT nFont1 NAME "Arial" HEIGHT 14 ITALIC BOLD DEFINE XLS FONT nFont2 NAME "Arial" UNDERLINE DEFINE XLS FONT nFont3 NAME "Arial Unicode MS" HEIGHT 9 DEFINE XLS FONT nFont4 NAME "Arial Unicode MS" HEIGHT 8 XLS oFileXLS FILE "MAESTRO1.XLS" //AUTOEXEC XLS COL 1 WIDTH 7 OF oFileXLS XLS COL 2 WIDTH 25 OF oFileXLS XLS COL 3 WIDTH 15 OF oFileXLS XLS COL 4 WIDTH 12 OF oFileXls XLS COL 5 WIDTH 12 OF oFileXls XLS COL 6 WIDTH 15 OF oFileXls nRow := 2 @ nRow,1 XLS SAY "EMPRESA DE SERVICIOS MULTIPLES " FONT nfont1 OF oFileXLS nRow++ @ nRow,1 XLS SAY "REPORTE GENERAL DE EMPLEADOS ACTIVOS" FONT nfont2 OF oFileXLS nRow++ @ nRow,1 XLS SAY "CLASIFICADO POR : "+ALLTRIM(xOrden) FONT nfont2 OF oFileXLS nRow++ @ nRow,1 XLS SAY "Numero" FONT nfont2 OF oFileXLS @ nRow,2 XLS SAY "Nombres " FONT nfont2 OF oFileXLS @ nRow,3 XLS SAY "Apellido1" FONT nfont2 OF oFileXLS @ nRow,4 XLS SAY "Apellido2" FONT nfont2 OF oFileXLS @ nRow,5 XLS SAY "Fec_Ing" FONT nfont2 OF oFileXLS @ nRow,6 XLS SAY "Inss" FONT nfont2 OF oFileXLS nRow += 2 GO TOP DO WHILE .NOT.EOF() mUnidad = A->COD_UNI nRow++ @ nRow,1 XLS SAY "UNIDAD ADMINISTRATIVA : "+A->COD_UNI+"-"+A->NOM_UNI FONT nfont2 OF oFileXLS nRow++ store 0 to nContar1 DO WHILE mUnidad = A->COD_UNI nRow++ @ nRow,1 xls say TRIM( A->NUMERO ) FONT nFont4 of oFilexls @ nRow,2 XLS SAY TRIM( A->NOMBRES) FONT nFont4 of oFilexls @ nRow,3 XLS SAY TRIM( A->APELLI1) FONT nFont4 of oFilexls @ nRow,4 XLS SAY TRIM( A->APELLI2) FONT nFont4 of oFilexls @ nRow,5 XLS SAY TRIM( DTOC(A->FEC_ING)) FONT nFont4 of oFilexls @ nRow,6 XLS SAY TRIM( A->INSSBI) FONT nFont4 of oFilexls nContar = nContar + 1 nContar1 = nContar1 + 1 SKIP ENDDO nRow++ nRow++ @ nRow,2 XLS SAY "Empleados x Unidad : "+STR(nContar1) FONT nfont3 OF oFileXLS ENDDO nRow++ nRow++ @ nRow,1 XLS SAY "Empleados " +STR(nContar) FONT nFont3 OF oFileXLS nRow++ nRow++ XLS PAGE BREAK AT nRow OF oFileXLS SET XLS TO DISPLAY ; NOGRIDLINES ; OF oFileXLS SET XLS TO PRINTER ; TOP MARGIN 0.6 ; BOTTOM MARGIN 0.8 ; LEFT MARGIN 0 ; OF oFileXLS ENDXLS oFileXLS oExcel:Visible := .T. oExcel:WorkBooks:Open(cFilePath(GetModuleFileName(GetInstance()))+"MAESTRO1.XLS") CLOSE RGEN1 // oHoja:End() // oExcel:End() RETURN NIL
¿Cómo enviar a Excel reporte con TPrinter?
Ramón, muchas gracias por responder. En verdad, no se me ha dado por usar filexls, directamente, aunque he leido bastante sobre el particular, en este foro. Actualmente utilizo RepExcel, que funciona satisfactoriamente pero solo con TReport. La idea que tengo es que desde el preview, con TPrinter, enviar el reporte a Excel. Es decir, mantener la opcion estándar de impresión con TPrinter-Preview, y poder elegir desde éste, su exportación a Excel. Agradezco el ejemplo que me facilitas, lo pruebo y luego te cuento. Saludos.
¿Cómo enviar a Excel reporte con TPrinter?
Querido Ramon Paredes, Es la clase FileXLS OLE depende?. Estoy buscando una clase que puede crear archivos de Excel, incluso si msexcel no está instalado en el PC. Parece que podemos hacer todo el formato de las columnas como el color, bold, Italics, etc ¿Puedo tener una copia de la clase FileXLS. Gracias de antemano Recuerdos Anser
¿Cómo enviar a Excel reporte con TPrinter?
Mi estimado anserkk Puedes bajar este archivo zip filexls.rar, en el van 3 prg 2 que son complementos de la clase y 1 la clase misma, unicamente tienes que agregarlos en tu proyecto como un prg mas y listo ya puedes usar toda la potencia de esta clase maravillosa, si necesitas ayuda o ejemplos me avisas que estamos para ayudarnos, El link es : <!-- m --><a class="postlink" href="http://www.megaupload.com/es/?d=2ATXPGVJ">http://www.megaupload.com/es/?d=2ATXPGVJ</a><!-- m --> Saludes Ramon Paredes
¿Cómo enviar a Excel reporte con TPrinter?
Estimado Ramón Paredes, Muchas gracias por el enlace de descarga. El zip contiene 3 PRG del saber TFileXLS.Prg XLSError.Prg XLSFunc.Prg Por lo que tengo que añadir todas estas 3 del prg a mi proyecto para la CLASS para funcionar correctamente. ¿Tengo razón? ¿Perdiste todo. CH archivos. Cuando he leído el código de ejemplo que envió por encima en este hilo parece que hay una. CH archivo XLS oFileXLS FILE "MAESTRO1.XLS" / / AUTOEXEC ¿Puede mostrarme una muestra PRG en Oop Sintaxis para, por ejemplo: oXls: = TFileXls ():New("C:\Prueba.xls") Una de las principales ventajas es que, esta CLASS no utiliza OLE, Para que MS-Excel no necesita ser instalado en el PC de la CLASS a la obra. Una vez que el archivo. Xls es creado usando esta clase, que se puede abrir a través de OpenOffice Calc. Una vez más gracias en gran medida de la CLASS ¿Me puede dar una muestra PRG mostrar el uso y la mayoría de las funcionalidades de esta excelente clase. Saludos Anser
¿Cómo enviar a Excel reporte con TPrinter?
Copio aqui el contenido de los ficheros para que no se pierdan <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> TFileXLS.prg [code:p998h0oo] // FileXLS Library by Ramón Avendaño // 30-12-99 #include "FiveWin&#46;ch" #include "Constant&#46;ch" //#include "XLSError&#46;ch" #include "FileIO&#46;ch" //#define _MSLINK_ static nInfo, cInfo &#58;= "FileXLS Library" + CRLF + ; "Ramón Avendaño (c) 1999" // Cell alignament #define ALING_NULL 0 #define ALING_LEFT 1 #define ALING_CENTER 2 #define ALING_RIGHT 3 #define ALING_FILL 4 // Cell border #define BORDER_NONE 0 #define BORDER_LEFT 8 #define BORDER_RIGHT 16 #define BORDER_TOP 32 #define BORDER_BOTTOM 64 #define BORDER_ALL 120 // nOR( BORDER_LEFT, BORDER_RIGHT, BORDER_TOP, BORDER_BOTTOM ) // XLS font def #define XLSFONT_HEIGHT 1 #define XLSFONT_BOLD 2 #define XLSFONT_ITALIC 3 #define XLSFONT_UNDERLINE 4 #define XLSFONT_STRIKEOUT 5 #define XLSFONT_NAME 6 // XLS error code #define XLSERROR_NULL 0 #define XLSERROR_DIV0 7 #define XLSERROR_VALUE 15 #define XLSERROR_REF 23 #define XLSERROR_NAME 29 #define XLSERROR_NUM 36 #define XLSERROR_N_A 42 EXTERNAL _XLSGenError #ifdef _MSLINK_ EXTERNAL xlsCELL, xlsSUM, xlsMULT EXTERNAL xlsABS, xlsINTE, xlsMOD, xlsROUND, xlsSIGN, xlsSQRT, xlsEXP, xlsLN, xlsLOG, ; xlsPI, xlsRANDOM, xlsSIN, xlsCOS, xlsTAN, xlsASIN, xlsACOS, xlsATAN #else EXTERNAL _CELL, _SUM, _MULT EXTERNAL _ABS, _INTE, _MOD, _ROUND, _SIGN, _SQRT, _EXP, _LN, _LOG, ; _PI, _RANDOM, _SIN, _COS, _TAN, _ASIN, _ACOS, _ATAN #endif static aFonts &#58;= {}, aFormats &#58;= {} static aOperators &#58;= { "", "", "+", "-", "*", "/", "^" } //----------------------------------------------------------------------------// CLASS TFileXLS DATA cName DATA hFile DATA oWnd DATA lProtect DATA lAutoexec DATA aHBreaks, aVBreaks METHOD New( cFileName, lAutomatic, nIterations,; lProtect, lAutoexec, oWnd ) CONSTRUCTOR METHOD End() // METHOD SetDisplay( nTop, nLeft, nBottom, nRight, lHidden, ; lFormulas, lGridLines, lHeaders, lNoZero ) METHOD SetPrinter( cHeader, cFooter, nLeft, nRight, nTop, nBottom, ; lHeaders, lGredlines ) // METHOD _Row( nRow, nHeight ) METHOD _Col( nFirstCol, nLastCol, nWidth ) // METHOD Blank( nRow, nCol, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) METHOD Number( nRow, nCol, nNumber, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) METHOD String( nRow, nCol, cString, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) METHOD _Date( nRow, nCol, dDate, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) METHOD Boolean( nRow, nCol, lBoolean, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) METHOD Formula( nRow, nCol, nNumber, lRecalc, cFormula, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) METHOD Say( nRow, nCol, uVal, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) METHOD Error( nRow, nCol, nError, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) // METHOD Note( nRow, nCol, cNote ) METHOD AddBreak( cCourse, aPos ) // METHOD PutCoors( nRow, nCol ) METHOD PutAttributes( lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament, nReserved ) // METHOD Info() INLINE MsgInfo( cInfo ) METHOD Protec() INLINE nInfo &#58;= 0, ; AEval( Array( len( cInfo ) ), ; {| a, n | nInfo += Asc( SubStr( cInfo, n, 1 ) ) + n } ), ; nInfo ENDCLASS //----------------------------------------------------------------------------// METHOD New( cFileName, lAutomatic, nIterations,; lProtect, lAutoexec, oWnd ) CLASS TFileXLS local n, nByte local nLen if &#58;&#58;Protec() != 4311 MsgStop( "FileXLS Library" + CRLF + "Copyright violation !" ) quit endif DEFAULT cFileName &#58;= cTempFile() + "&#46;xls" &#58;&#58;cName = cFileName &#58;&#58;hFile = FCreate( cFileName, FC_NORMAL ) &#58;&#58;lProtect = lProtect &#58;&#58;lAutoexec = lAutoexec &#58;&#58;oWnd = oWnd &#58;&#58;aHBreaks &#58;= {} &#58;&#58;aVBreaks &#58;= {} DEFAULT lAutomatic &#58;= &#46;t&#46;, nIterations &#58;= 0 FWrite( &#58;&#58;hFile, Chr( 09 ) + Chr( 00 ), 2 ) // BOF FWrite( &#58;&#58;hFile, Chr( 04 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 05 ) + Chr( 00 ) + Chr( 16 ) + Chr( 00 ), 4 ) FWrite( &#58;&#58;hFile, Chr( 13 ) + Chr( 00 ), 2 ) // CALCMODE FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( if( lAutomatic, 1, 0 ) ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 12 ) + Chr( 00 ), 2 ) // CALCCOUNT FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( if( nIterations != 0, nIterations, 1 ) ), 2 ) FWrite( &#58;&#58;hFile, Chr( 15 ) + Chr( 00 ), 2 ) // REFMODE FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 01 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 17 ) + Chr( 00 ), 2 ) // ITERATION FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( if( nIterations != 0, 1, 0 ) ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 16 ) + Chr( 00 ), 2 ) // DELTA FWrite( &#58;&#58;hFile, Chr( 08 ) + Chr( 00 ), 2 ) // 0&#46;001 FWrite( &#58;&#58;hFile, D2Bin( 0&#46;001 ), 8 ) FWrite( &#58;&#58;hFile, Chr( 14 ) + Chr( 00 ), 2 ) // PRECISION FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) // full FWrite( &#58;&#58;hFile, Chr( 01 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 34 ) + Chr( 00 ), 2 ) // 1904 FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) // anything FWrite( &#58;&#58;hFile, Chr( 00 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 37 ) + Chr( 00 ), 2 ) // DEFAULT ROW HEIGHT FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) // 33023 FWrite( &#58;&#58;hFile, I2Bin( 33023 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 49 ) + Chr( 00 ), 2 ) // FONT 0 FWrite( &#58;&#58;hFile, Chr( 10 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 200 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 00 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 05 ), 1 ) FWrite( &#58;&#58;hFile, "Arial", 5 ) For n &#58;= 1 to 3 if n > len( aFonts ) FWrite( &#58;&#58;hFile, Chr( 49 ) + Chr( 00 ), 2 ) // FONT FWrite( &#58;&#58;hFile, Chr( 10 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 200 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 00 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 05 ), 1 ) FWrite( &#58;&#58;hFile, "Arial", 5 ) else nByte &#58;= 0; nLen &#58;= len( aFonts&#91; n, XLSFONT_NAME &#93; ) // FONT n FWrite( &#58;&#58;hFile, Chr( 49 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( 05 + nLen ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( aFonts&#91; n, XLSFONT_HEIGHT &#93; ), 2 ) nByte &#58;= nOR( nByte, if( aFonts&#91; n, XLSFONT_BOLD &#93;, 1, 0 ) ) nByte &#58;= nOR( nByte, if( aFonts&#91; n, XLSFONT_ITALIC &#93;, 2, 0 ) ) nByte &#58;= nOR( nByte, if( aFonts&#91; n, XLSFONT_UNDERLINE &#93;, 4, 0 ) ) nByte &#58;= nOR( nByte, if( aFonts&#91; n, XLSFONT_STRIKEOUT &#93;, 8, 0 ) ) FWrite( &#58;&#58;hFile, Chr( nByte ), 1 ) FWrite( &#58;&#58;hFile, Chr( 00 ), 1 ) FWrite( &#58;&#58;hFile, Chr( nLen ), 1 ) FWrite( &#58;&#58;hFile, aFonts&#91; n, XLSFONT_NAME &#93;, nLen ) endif next FWrite( &#58;&#58;hFile, Chr( 64 ) + Chr( 00 ), 2 ) // BACKUP FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) // not back up FWrite( &#58;&#58;hFile, Chr( 00 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 31 ) + Chr( 00 ), 2 ) // FORMATCOUNT FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) // 1 FWrite( &#58;&#58;hFile, Chr( 01 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 30 ) + Chr( 00 ), 2 ) // FORMAT 0 FWrite( &#58;&#58;hFile, Chr( 08 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 07 ), 1 ) FWrite( &#58;&#58;hFile, "General", 7 ) For n &#58;= 1 to len( aFormats ) nLen &#58;= len( aFormats&#91; n &#93; ) FWrite( &#58;&#58;hFile, Chr( 30 ) + Chr( 00 ), 2 ) // FORMAT n FWrite( &#58;&#58;hFile, I2Bin( nLen + 1 ), 2 ) FWrite( &#58;&#58;hFile, Chr( nLen ), 1 ) FWrite( &#58;&#58;hFile, aFormats&#91; n &#93;, nLen ) next return Self //----------------------------------------------------------------------------// METHOD End() CLASS TFileXLS local n local nLen local nReturn &#58;= 0 nLen &#58;= Len( &#58;&#58;aHBreaks ) // HORIZONTAL BREAK FWrite( &#58;&#58;hFile, Chr( 27 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( 02 + nLen * 2 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( nLen ), 2 ) for n &#58;= 1 to nLen FWrite( &#58;&#58;hFile, I2Bin( &#58;&#58;aHBreaks&#91; n &#93; - 1 ), 2 ) next nLen &#58;= Len( &#58;&#58;aVBreaks ) // VERTICAL BREAK FWrite( &#58;&#58;hFile, Chr( 26 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( 02 + nLen * 2 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( nLen ), 2 ) for n &#58;= 1 to nLen FWrite( &#58;&#58;hFile, I2Bin( &#58;&#58;aVBreaks&#91; n &#93; - 1 ), 2 ) next FWrite( &#58;&#58;hFile, Chr( 18 ) + Chr( 00 ), 2 ) // PROTECT FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( if( &#58;&#58;lProtect, 1, 0 ) ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 10 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 00 ) + Chr( 00 ), 2 ) FClose( &#58;&#58;hFile ) &#58;&#58;hFile &#58;= 0 if &#58;&#58;lAutoexec // WinExec( "start Excel " + &#58;&#58;cName, 0 ) // nReturn &#58;= ShellExecute( 0, 'Open', &#58;&#58;cName,,, 2 ) nReturn &#58;= ShellExecute( if( &#58;&#58;oWnd != nil, &#58;&#58;oWnd&#58;hWnd, GetActiveWindow() ), ; 'Open', &#58;&#58;cName,,, 2 ) endif return nReturn //----------------------------------------------------------------------------// // Support functions for TFileXLS class FUNCTION XLSFont( cName, nHeight, ; lBold, lItalic, lUnderline, lStrikeout ) local nFont DEFAULT cName &#58;= "Arial", nHeight &#58;= 10, ; lBold &#58;= &#46;f&#46;, lItalic &#58;= &#46;f&#46;, lUnderline &#58;= &#46;f&#46;, lStrikeout &#58;= &#46;f&#46; nFont &#58;= AScan( aFonts, {|a| a&#91;1&#93; == nHeight * 20 &#46;and&#46; ; a&#91;2&#93; == lBold &#46;and&#46; ; a&#91;3&#93; == lItalic &#46;and&#46; ; a&#91;4&#93; == lUnderline &#46;and&#46; ; a&#91;5&#93; == lStrikeout &#46;and&#46; ; a&#91;6&#93; == cName } ) if nFont == 0 AAdd( aFonts, { nHeight * 20, lBold, lItalic, lUnderline, lStrikeout, cName } ) nFont &#58;= Len( aFonts ) endif return nFont // FUNCTION XLSFormat( cPicture ) local nFormat DEFAULT cPicture &#58;= "0" nFormat &#58;= AScan( aFormats, cPicture ) if nFormat == 0 AAdd( aFormats, cPicture ) nFormat &#58;= Len( aFormats ) endif return nFormat // FUNCTION XLSClsFont() return( aFonts &#58;= {} ) // FUNCTION XLSClsFormat() return( aFormats &#58;= {} ) //----------------------------------------------------------------------------// METHOD SetDisplay( nTop, nLeft, nBottom, nRight, lHidden, ; lFormulas, lGridLines, lHeaders, lNoZero ) DEFAULT nTop &#58;= 0, nLeft &#58;= 0, nBottom &#58;= 200, nRight &#58;= 300 FWrite( &#58;&#58;hFile, Chr( 61 ) + Chr( 00 ), 2 ) // WINDOWS1 FWrite( &#58;&#58;hFile, Chr( 09 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( nLeft * 20 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( nTop * 20 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( ( nRight - nLeft + 1 ) * 20 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( ( nBottom - nTop + 1 ) * 20 ), 2 ) FWrite( &#58;&#58;hFile, Chr( if( lHidden, 1, 0 ) ), 1 ) FWrite( &#58;&#58;hFile, Chr( 62 ) + Chr( 00 ), 2 ) // WINDOWS2 FWrite( &#58;&#58;hFile, Chr( 14 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( if( lFormulas, 1, 0 ) ), 1 ) FWrite( &#58;&#58;hFile, Chr( if( lGridLines, 1, 0 ) ), 1 ) FWrite( &#58;&#58;hFile, Chr( if( lHeaders, 1, 0 ) ), 1 ) FWrite( &#58;&#58;hFile, Chr( 00 ), 1 ) FWrite( &#58;&#58;hFile, Chr( if( lNoZero, 0, 1 ) ), 1 ) FWrite( &#58;&#58;hFile, I2Bin( 00 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 01 ), 1 ) FWrite( &#58;&#58;hFile, L2Bin( 00 ), 4 ) return nil //----------------------------------------------------------------------------// METHOD SetPrinter( cHeader, cFooter, nLeft, nRight, nTop, nBottom, ; lHeaders, lGredlines ) CLASS TFileXLS local nLen DEFAULT cHeader &#58;= "", cFooter &#58;= "", ; nLeft &#58;= 0, nRight &#58;= 0, nTop &#58;= 0, nBottom &#58;= 0, ; lHeaders &#58;= &#46;f&#46;, lGredlines &#58;= &#46;f&#46; nLen &#58;= Len( cHeader ) // HEADER FWrite( &#58;&#58;hFile, Chr( 20 ) + Chr( 00 ), 2 ) if nLen == 0 FWrite( &#58;&#58;hFile, Chr( 00 ) + Chr( 00 ), 2 ) else FWrite( &#58;&#58;hFile, I2Bin( 01 + nLen ), 2 ) FWrite( &#58;&#58;hFile, Chr( nLen ), 1 ) FWrite( &#58;&#58;hFile, cHeader, nLen ) endif nLen &#58;= Len( cFooter ) // FOOTER FWrite( &#58;&#58;hFile, Chr( 21 ) + Chr( 00 ), 2 ) if nLen == 0 FWrite( &#58;&#58;hFile, Chr( 00 ) + Chr( 00 ), 2 ) else FWrite( &#58;&#58;hFile, I2Bin( 01 + nLen ), 2 ) FWrite( &#58;&#58;hFile, Chr( nLen ), 1 ) FWrite( &#58;&#58;hFile, cFooter, nLen ) endif FWrite( &#58;&#58;hFile, Chr( 38 ) + Chr( 00 ), 2 ) // LEFT MARGIN FWrite( &#58;&#58;hFile, Chr( 08 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, D2Bin( nLeft ), 8 ) FWrite( &#58;&#58;hFile, Chr( 39 ) + Chr( 00 ), 2 ) // RIGHT MARGIN FWrite( &#58;&#58;hFile, Chr( 08 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, D2Bin( nRight ), 8 ) FWrite( &#58;&#58;hFile, Chr( 40 ) + Chr( 00 ), 2 ) // TOP MARGIN FWrite( &#58;&#58;hFile, Chr( 08 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, D2Bin( nTop ), 8 ) FWrite( &#58;&#58;hFile, Chr( 41 ) + Chr( 00 ), 2 ) // BOTTOM MARGIN FWrite( &#58;&#58;hFile, Chr( 08 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, D2Bin( nBottom ), 8 ) FWrite( &#58;&#58;hFile, Chr( 42 ) + Chr( 00 ), 2 ) // PRINT HEADERS FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( if( lHeaders, 1, 0 ) ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 43 ) + Chr( 00 ), 2 ) // PRINT GRIDLINES FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( if( lGredlines, 1, 0 ) ) + Chr( 00 ), 2 ) return nil //----------------------------------------------------------------------------// METHOD _Row( nRow, nHeight ) CLASS TFileXLS DEFAULT nHeight &#58;= 12&#46;75 FWrite( &#58;&#58;hFile, Chr( 08 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 16 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( nRow - 1 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( 00 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( 00 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( nHeight * 20 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 00 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 00 ), 1 ) FWrite( &#58;&#58;hFile, Chr( 00 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 00 ) + Chr( 00 ) + Chr( 00 ), 3 ) return nil //----------------------------------------------------------------------------// METHOD _Col( nFirstCol, nLastCol, nWidth, lHide ) DEFAULT lHide &#58;= &#46;f&#46; DEFAULT nWidth &#58;= 10&#46;71 DEFAULT nLastCol &#58;= nFirstCol FWrite( &#58;&#58;hFile, Chr( 36 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 04 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( nFirstCol - 1 ), 1 ) FWrite( &#58;&#58;hFile, Chr( nLastCol - 1 ), 1 ) if lHide FWrite( &#58;&#58;hFile, I2Bin( 0 ), 2 ) else FWrite( &#58;&#58;hFile, I2Bin( Round( ( nWidth + 0&#46;72 ) * 256, 0) ), 2 ) endif return nil //----------------------------------------------------------------------------// METHOD Blank( nRow, nCol, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) CLASS TFileXLS DEFAULT lHidden &#58;= &#46;f&#46;, lLocked &#58;= &#46;f&#46;, nFont &#58;= 0, nFormat &#58;= 0, lShaded &#58;= &#46;f&#46;, ; nBorder &#58;= BORDER_NONE, nAlignament &#58;= ALING_NULL FWrite( &#58;&#58;hFile, Chr( 01 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 07 ) + Chr( 00 ), 2 ) &#58;&#58;PutCoors( nRow, nCol ) &#58;&#58;PutAttributes( lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) return nil //----------------------------------------------------------------------------// METHOD Number( nRow, nCol, nNumber, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) CLASS TFileXLS local lInteger &#58;= lInteger( nNumber ) DEFAULT lHidden &#58;= &#46;f&#46;, lLocked &#58;= &#46;f&#46;, nFont &#58;= 0, nFormat &#58;= 0, lShaded &#58;= &#46;f&#46;, ; nBorder &#58;= BORDER_NONE, nAlignament &#58;= ALING_NULL if lInteger FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 09 ) + Chr( 00 ), 2 ) else FWrite( &#58;&#58;hFile, Chr( 03 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 15 ) + Chr( 00 ), 2 ) endif &#58;&#58;PutCoors( nRow, nCol ) &#58;&#58;PutAttributes( lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) if lInteger FWrite( &#58;&#58;hFile, I2Bin( nNumber ), 2 ) else FWrite( &#58;&#58;hFile, D2Bin( nNumber ), 8 ) endif return nil //----------------------------------------------------------------------------// METHOD String( nRow, nCol, cString, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) CLASS TFileXLS local nLen &#58;= Len( cString ) DEFAULT lHidden &#58;= &#46;f&#46;, lLocked &#58;= &#46;f&#46;, nFont &#58;= 0, nFormat &#58;= 0, lShaded &#58;= &#46;f&#46;, ; nBorder &#58;= BORDER_NONE, nAlignament &#58;= ALING_NULL FWrite( &#58;&#58;hFile, Chr( 04 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( 08 + nLen ), 2 ) &#58;&#58;PutCoors( nRow, nCol ) &#58;&#58;PutAttributes( lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) FWrite( &#58;&#58;hFile, Chr( nLen ), 1 ) FWrite( &#58;&#58;hFile, cString, nLen ) return nil //----------------------------------------------------------------------------// METHOD _Date( nRow, nCol, dDate, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) CLASS TFileXLS local nDate DEFAULT lHidden &#58;= &#46;f&#46;, lLocked &#58;= &#46;f&#46;, nFont &#58;= 0, nFormat &#58;= 0, lShaded &#58;= &#46;f&#46;, ; nBorder &#58;= BORDER_NONE, nAlignament &#58;= ALING_NULL FWrite( &#58;&#58;hFile, Chr( 02 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 09 ) + Chr( 00 ), 2 ) &#58;&#58;PutCoors( nRow, nCol ) &#58;&#58;PutAttributes( lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament, 0 ) nDate &#58;= dDate - CToD( "01/01/1900" ) + 2 FWrite( &#58;&#58;hFile, I2Bin( nDate ), 2 ) return nil //----------------------------------------------------------------------------// METHOD Boolean( nRow, nCol, lBoolean, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) CLASS TFileXLS DEFAULT lHidden &#58;= &#46;f&#46;, lLocked &#58;= &#46;f&#46;, nFont &#58;= 0, nFormat &#58;= 0, lShaded &#58;= &#46;f&#46;, ; nBorder &#58;= BORDER_NONE, nAlignament &#58;= ALING_NULL FWrite( &#58;&#58;hFile, Chr( 05 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 09 ) + Chr( 00 ), 2 ) &#58;&#58;PutCoors( nRow, nCol ) &#58;&#58;PutAttributes( lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) FWrite( &#58;&#58;hFile, Chr( if( lBoolean, 1, 0 ) ), 1 ) FWrite( &#58;&#58;hFile, Chr( 00 ), 1 ) return nil //----------------------------------------------------------------------------// METHOD Formula( nRow, nCol, nNumber, lRecalc, cFormula, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) CLASS TFileXLS local cExpression &#58;= GetExpression( cFormula ) local nLen &#58;= Len( cExpression ) DEFAULT nNumber &#58;= 0, lRecalc &#58;= &#46;t&#46; DEFAULT lHidden &#58;= &#46;f&#46;, lLocked &#58;= &#46;f&#46;, nFont &#58;= 0, nFormat &#58;= 0, lShaded &#58;= &#46;f&#46;, ; nBorder &#58;= BORDER_NONE, nAlignament &#58;= ALING_NULL FWrite( &#58;&#58;hFile, Chr( 06 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( 17 + nLen ), 2 ) &#58;&#58;PutCoors( nRow, nCol ) &#58;&#58;PutAttributes( lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) FWrite( &#58;&#58;hFile, D2Bin( nNumber ), 8 ) FWrite( &#58;&#58;hFile, Chr( if( lRecalc, 2, 0 ) ), 1 ) FWrite( &#58;&#58;hFile, Chr( nLen ), 1 ) FWrite( &#58;&#58;hFile, cExpression, nLen ) return nil //----------------------------------------------------------------------------// METHOD Say( nRow, nCol, uVal, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) CLASS TFileXLS local cType &#58;= ValType( uVal ) if cType == "B" uVal &#58;= Eval( uVal ) cType &#58;= ValType( uVal ) endif do case case cType == "N" &#58;&#58;Number( nRow, nCol, uVal, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) case cType == "C" &#46;or&#46; cType == "M" &#58;&#58;String( nRow, nCol, uVal, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) case cType == "D" &#58;&#58;_Date( nRow, nCol, uVal, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) case cType == "L" &#58;&#58;Boolean( nRow, nCol, uVal, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) case cType == "U" &#58;&#58;Blank( nRow, nCol, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) otherwise Eval( ErrorBlock(), _XLSGenError( DATATYPE_NOSUPPORT, ; CHR(13)+CHR(10) + "Type&#58; " + cType ) ) endcase return nil //----------------------------------------------------------------------------// METHOD Error( nRow, nCol, nError, ; lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) CLASS TFileXLS DEFAULT lHidden &#58;= &#46;f&#46;, lLocked &#58;= &#46;f&#46;, nFont &#58;= 0, nFormat &#58;= 0, lShaded &#58;= &#46;f&#46;, ; nBorder &#58;= BORDER_NONE, nAlignament &#58;= ALING_NULL FWrite( &#58;&#58;hFile, Chr( 05 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, Chr( 09 ) + Chr( 00 ), 2 ) &#58;&#58;PutCoors( nRow, nCol ) &#58;&#58;PutAttributes( lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament ) FWrite( &#58;&#58;hFile, Chr( nError ), 1 ) FWrite( &#58;&#58;hFile, Chr( 01 ), 1 ) return nil //----------------------------------------------------------------------------// METHOD Note( nRow, nCol, cNote ) CLASS TFileXLS local nLen &#58;= Len( cNote ) FWrite( &#58;&#58;hFile, Chr( 28 ) + Chr( 00 ), 2 ) FWrite( &#58;&#58;hFile, I2Bin( 06 + nLen ), 2 ) &#58;&#58;PutCoors( nRow, nCol ) FWrite( &#58;&#58;hFile, I2Bin( nLen ), 2 ) FWrite( &#58;&#58;hFile, cNote, nLen ) return nil //----------------------------------------------------------------------------// METHOD AddBreak( cCourse, aBreaks ) CLASS TFileXLS DEFAULT cCourse &#58;= "HORIZONTAL" do case case cCourse == "HORIZONTAL" AEval( aBreaks, {|nBreak| if( AScan( &#58;&#58;aHBreaks, nBreak ) == 0, ; AAdd( &#58;&#58;aHBreaks, nBreak ), ) } ) ASort( &#58;&#58;aHBreaks ) case cCourse == "VERTICAL" AEval( aBreaks, {|nBreak| if( AScan( &#58;&#58;aVBreaks, nBreak ) == 0, ; AAdd( &#58;&#58;aVBreaks, nBreak ), ) } ) ASort( &#58;&#58;aVBreaks ) endcase return nil //----------------------------------------------------------------------------// METHOD PutCoors( nRow, nCol ) CLASS TFileXLS local cWord cWord &#58;= I2Bin( nRow - 1 ) FWrite( &#58;&#58;hFile, @cWord, 2 ) // Byte Offset 0-1 cWord &#58;= I2Bin( nCol - 1 ) FWrite( &#58;&#58;hFile, @cWord, 2 ) // Byte Offset 2-3 return nil //----------------------------------------------------------------------------// METHOD PutAttributes( lHidden, lLocked, nFont, nFormat, lShaded, ; nBorder, nAlignament, nReserved ) CLASS TFileXLS local nByte, cByte DEFAULT nReserved &#58;= 0 nByte &#58;= 0 if lHidden nByte &#58;= 128 endif if lLocked nByte &#58;= nOR( nByte, 64 ) endif nByte &#58;= nOR( nByte, nReserved ) cByte &#58;= Chr( nByte ) FWrite( &#58;&#58;hFile, @cByte, 1 ) // Byte Offset 0 if nFont == 0 nByte &#58;= 0 elseif nFont == 1 nByte &#58;= 64 elseif nFont == 2 nByte &#58;= 128 else nByte &#58;= 192 endif nByte &#58;= nOR( nByte, nFormat ) cByte &#58;= Chr( nByte ) FWrite( &#58;&#58;hFile, @cByte, 1 ) // Byte Offset 1 nByte &#58;= 0 if lShaded nByte &#58;= 128 endif nByte &#58;= nOR( nByte, nBorder ) nByte &#58;= nOR( nByte, nAlignament ) cByte &#58;= Chr( nByte ) FWrite( &#58;&#58;hFile, @cByte, 1 ) // Byte Offset 3 return nil // Static functions //----------------------------------------------------------------------------// static function GetExpression( cFormula ) local n, nLen local cExpression &#58;= "" local cLabel&#58;= "", cNumber &#58;= "", cFunction &#58;= "" local cOperator &#58;= "", nPart, cChar, cSign &#58;= "" local lOperator &#58;= &#46;f&#46;, lFunction &#58;= &#46;f&#46;, lParenthetically &#58;= &#46;f&#46; local aBuffer &#58;= {} cFormula &#58;= StrTran( cFormula, " ", "" ) nLen &#58;= Len( cFormula ) n &#58;= 1 do while n <= nLen cChar &#58;= Upper( SubStr( cFormula, n, 1 ) ) do case case cChar $ "0123456789&#46;" if empty( cLabel ) cNumber += cChar else cLabel += cChar endif case Asc( cChar ) >= 65 &#46;and&#46; Asc( cChar ) <= 90 ; &#46;or&#46; cChar == "_" cLabel += cChar case cChar $ "+-*/^" if lParenthetically &#46;or&#46; ; !empty( cNumber ) &#46;or&#46; !empty( cLabel ) &#46;or&#46; !empty( cfunction ) if empty( cOperator ) elseif ( cChar$"*/^" &#46;and&#46; cOperator$"+-" )&#46;or&#46; ; ( cChar$"^" &#46;and&#46; cOperator$"*/" ) AAdd( aBuffer, cOperator ) cOperator &#58;= "" lParenthetically &#58;= &#46;f&#46; elseif ( cChar$"+-" &#46;and&#46; cOperator$"*/^" )&#46;or&#46; ; ( cChar$"*/" &#46;and&#46; cOperator$"^" ) lOperator &#58;= &#46;t&#46; endif if !empty( cNumber ) cExpression += GetNumber( Val( cNumber ), cSign, cOperator ) elseif !empty ( cLabel ) cExpression += GetNumber( &cLabel, cSign, cOperator ) elseif !empty( cfunction ) cExpression += GetFunction( cFunction, cSign, cOperator ) endif cNumber &#58;= cLabel &#58;= cFunction &#58;= "" if lParenthetically if !empty( cOperator ) cExpression += Chr( AScan( aOperators, cOperator ) ) endif lParenthetically &#58;= &#46;f&#46; endif if lOperator do while len( aBuffer ) != 0 &#46;and&#46; Atail( aBuffer ) != "P" if !empty( Atail( aBuffer ) ) cExpression += Chr( AScan( aOperators, Atail( aBuffer ) ) ) endif ASize( aBuffer, len( aBuffer ) - 1 ) enddo lOperator &#58;= &#46;f&#46; endif cOperator &#58;= cChar cSign &#58;= "" else cSign &#58;= cChar endif case cChar == "(" if empty( cLabel ) AAdd( aBuffer, cOperator ) AAdd( aBuffer, "P" ) cOperator &#58;= "" else #ifdef _MSLINK_ lFunction &#58;= Upper( Left( clabel, 3 ) ) == "XLS" #else lFunction &#58;= Left( clabel, 1 ) == "_" #endif nPart &#58;= 1 cLabel += "(" do while nPart != 0 n++ cChar &#58;= SubStr( cFormula, n, 1 ) do case case cChar == "(" nPart++ case cChar == ")" nPart-- case lFunction &#46;and&#46; ; cChar == "," &#46;and&#46; nPart = 1 cChar &#58;= ";" endcase cLabel += cChar enddo if lFunction cFunction &#58;= cLabel cLabel &#58;= "" else cLabel &#58;= AllTrim( cValToChar( &cLabel ) ) endif endif case cChar == ")" if !empty( cNumber ) cExpression += GetNumber( Val( cNumber ), cSign, cOperator ) elseif !empty ( cLabel ) cExpression += GetNumber( &cLabel, cSign, cOperator ) elseif !empty( cfunction ) cExpression += GetFunction( cFunction, cSign, cOperator ) endif cNumber &#58;= cLabel &#58;= cFunction &#58;= "" if lParenthetically if !empty( cOperator ) cExpression += Chr( AScan( aOperators, cOperator ) ) endif lParenthetically &#58;= &#46;f&#46; endif do while Atail( aBuffer ) != "P" if !empty( Atail( aBuffer ) ) cExpression += Chr( AScan( aOperators, Atail( aBuffer ) ) ) endif ASize( aBuffer, len( aBuffer ) - 1 ) enddo cExpression += Chr( 21 ) ASize( aBuffer, len( aBuffer ) - 1 ) cOperator &#58;= Atail( aBuffer ) ASize( aBuffer, len( aBuffer ) - 1 ) lParenthetically &#58;= &#46;t&#46; otherwise Eval( ErrorBlock(), _XLSGenError( SYNTATIC_ERROR, ; CHR(13)+CHR(10) + cChar ) ) endcase n++ enddo if !empty( cNumber ) cExpression += GetNumber( Val( cNumber ), cSign, cOperator ) elseif !empty( cLabel ) cExpression += GetNumber( &cLabel, cSign, cOperator ) elseif !empty( cfunction ) cExpression += GetFunction( cFunction, cSign, cOperator ) endif if lParenthetically if !empty( cOperator ) cExpression += Chr( AScan( aOperators, cOperator ) ) endif lParenthetically &#58;= &#46;f&#46; endif do while len( aBuffer ) != 0 cOperator &#58;= Atail( aBuffer ) if cOperator == "P" cExpression += Chr( 21 ) else if !empty( cOperator ) cExpression += Chr( AScan( aOperators, cOperator ) ) endif endif ASize( aBuffer, len( aBuffer ) - 1 ) enddo return cExpression //----------------------------------------------------------------------------// Static function GetNumber( nNumber, cSign, cOperator ) local cExpression &#58;= "" nNumber *= if( cSign == "-", -1, +1 ) if lInteger( nNumber ) cExpression += Chr( 30 ) cExpression += I2Bin( nNumber ) else cExpression += Chr( 31 ) cExpression += D2Bin( nNumber ) endif if !empty( cOperator ) cExpression += Chr( AScan( aOperators, cOperator ) ) endif return cExpression //----------------------------------------------------------------------------// Static function GetFunction( cFunction, cSign, cOperator ) local cExpression &#58;= "" local n, nType, cVal, nVal, nPar &#58;= 1, aPar &#58;= {}, aVal &#58;= {}, uVal local cName &#58;= Left( cFunction, At( "(", cFunction ) - 1 ) local cParameters &#58;= SubStr( cFunction, At( "(", cFunction ) ) cParameters &#58;= SubStr( cParameters, 2, len( cParameters ) - 2 ) do while ( n &#58;= At( ";", SubStr( cParameters, nPar ) ) ) != 0 cVal &#58;= SubStr( cParameters, nPar, n - 1 ) AAdd( aPar, cVal ) uVal &#58;= &cVal AAdd( aVal, uVal ) nPar += n enddo if !empty( cParameters ) cVal &#58;= SubStr( cParameters, nPar ) AAdd( aPar, cVal ) uVal &#58;= &cVal AAdd( aVal, uVal ) endif do case // Funct&#46; Cell&#46; #ifdef _MSLINK_ case cName == "XLSCELL" #else case cName == "_CELL" #endif cExpression += Chr( 68 ) nType &#58;= 192 if len( aVal ) > 3 &#46;and&#46; aVal&#91; 4 &#93; nType -= 64 endif if len( aVal ) > 2 &#46;and&#46; aVal&#91; 3 &#93; nType -= 128 endif nVal &#58;= aVal&#91; 1 &#93; - 1 cExpression += Chr( nLoByte( nVal ) ) + Chr( nHiByte( nVal ) + nType ) nVal &#58;= aVal&#91; 2 &#93; - 1 cExpression += Chr( nVal ) #ifdef _MSLINK_ case cName == "XLSSUM" #else case cName == "_SUM" #endif cExpression += Chr( 37 ) nType &#58;= 192 if len( aVal ) > 5 &#46;and&#46; aVal&#91; 6 &#93; nType -= 64 endif if len( aVal ) > 4 &#46;and&#46; aVal&#91; 5 &#93; nType -= 128 endif nVal &#58;= aVal&#91; 1 &#93; - 1 cExpression += Chr( nLoByte( nVal ) ) + Chr( nHiByte( nVal ) + nType ) nType &#58;= 192 if len( aVal ) > 7 &#46;and&#46; aVal&#91; 8 &#93; nType -= 64 endif if len( aVal ) > 6 &#46;and&#46; aVal&#91; 7 &#93; nType -= 128 endif nVal &#58;= aVal&#91; 3 &#93; - 1 cExpression += Chr( nLoByte( nVal ) ) + Chr( nHiByte( nVal ) + nType ) nVal &#58;= aVal&#91; 2 &#93; - 1 cExpression += Chr( nVal ) nVal &#58;= aVal&#91; 4 &#93; - 1 cExpression += Chr( nVal ) cExpression += Chr( 25 ) + Chr( 16 ) + Chr( 00 ) #ifdef _MSLINK_ case cName == "XLSMULT" #else case cName == "_MULT" #endif cExpression += Chr( 37 ) nType &#58;= 192 if len( aVal ) > 5 &#46;and&#46; aVal&#91; 6 &#93; nType -= 64 endif if len( aVal ) > 4 &#46;and&#46; aVal&#91; 5 &#93; nType -= 128 endif nVal &#58;= aVal&#91; 1 &#93; - 1 cExpression += Chr( nLoByte( nVal ) ) + Chr( nHiByte( nVal ) + nType ) nType &#58;= 192 if len( aVal ) > 7 &#46;and&#46; aVal&#91; 8 &#93; nType -= 64 endif if len( aVal ) > 6 &#46;and&#46; aVal&#91; 7 &#93; nType -= 128 endif nVal &#58;= aVal&#91; 3 &#93; - 1 cExpression += Chr( nLoByte( nVal ) ) + Chr( nHiByte( nVal ) + nType ) nVal &#58;= aVal&#91; 2 &#93; - 1 cExpression += Chr( nVal ) nVal &#58;= aVal&#91; 4 &#93; - 1 cExpression += Chr( nVal ) cExpression += Chr( 66 ) + Chr( 01 ) + Chr( 183 ) // Funct&#46; Math #ifdef _MSLINK_ case cName == "XLSABS" #else case cName == "_ABS" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 24 ) #ifdef _MSLINK_ case cName == "XLSINTE" #else case cName == "_INTE" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 25 ) #ifdef _MSLINK_ case cName == "XLSMOD" #else case cName == "_MOD" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += GetExpression( aPar&#91; 2 &#93; ) cExpression += Chr( 65 ) + Chr( 39 ) #ifdef _MSLINK_ case cName == "XLSROUND" #else case cName == "_ROUND" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += GetExpression( aPar&#91; 2 &#93; ) cExpression += Chr( 65 ) + Chr( 27 ) #ifdef _MSLINK_ case cName == "XLSSIGN" #else case cName == "_SIGN" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 26 ) #ifdef _MSLINK_ case cName == "XLSSQRT" #else case cName == "_SQRT" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 20 ) #ifdef _MSLINK_ case cName == "XLSEXP" #else case cName == "_EXP" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 21 ) #ifdef _MSLINK_ case cName == "XLSLN" #else case cName == "_LN" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 22 ) #ifdef _MSLINK_ case cName == "XLSLOG" #else case cName == "_LOG" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 23 ) #ifdef _MSLINK_ case cName == "XLSPI" #else case cName == "_PI" #endif cExpression += Chr( 65 ) + Chr( 19 ) #ifdef _MSLINK_ case cName == "XLSRANDOM" #else case cName == "_RANDOM" #endif cExpression += Chr( 65 ) + Chr( 63 ) #ifdef _MSLINK_ case cName == "XLSSIN" #else case cName == "_SIN" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 15 ) #ifdef _MSLINK_ case cName == "XLSCOS" #else case cName == "_COS" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 16 ) #ifdef _MSLINK_ case cName == "XLSTAN" #else case cName == "_TAN" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 17 ) #ifdef _MSLINK_ case cName == "XLSASIN" #else case cName == "_ASIN" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 98 ) #ifdef _MSLINK_ case cName == "XLSACOS" #else case cName == "_ACOS" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 99 ) #ifdef _MSLINK_ case cName == "XLSATAN" #else case cName == "_ATAN" #endif cExpression += GetExpression( aPar&#91; 1 &#93; ) cExpression += Chr( 65 ) + Chr( 18 ) otherwise Eval( ErrorBlock(), _XLSGenError( NODEFINED_FUNCTION, ; CHR(13)+CHR(10) + "Function&#58; " + cName ) ) endcase if !empty( cSign ) cExpression += Chr( AScan( aOperators, cSign ) + 15 ) endif if !empty( cOperator ) cExpression += Chr( AScan( aOperators, cOperator ) ) endif return cExpression //----------------------------------------------------------------------------// Static function lInteger( nNumber ) return nNumber <= 65535 &#46;and&#46; nNumber >= 0 &#46;and&#46; ; ( nNumber - INT( nNumber ) ) == 0 [/code:p998h0oo] XLSError.prg [code:p998h0oo] // FileXLS automatic error generation #include "Error&#46;ch" //#include "XLSError&#46;ch" external ProcName, ErrorSys #define _SUBSYS_ "FileXLS" #define ERR_MESSAGE 1 #define ERR_SEVERITY 2 #define ERR_SUBSYS 3 #define ERR_ERR_NO 4 //----------------------------------------------------------------------------// FUNCTION _XLSGenError( nError, cOperation ) local aErr &#58;= { { "Non defined XLS function", ES_CATASTROPHIC,, },; { "Formula syntactic error", ES_CATASTROPHIC,, },; { "Data type XLS no support", ES_WARNING,, } } local oError if nError > 0 &#46;and&#46; nError <= MAX_DEFINED_ERRORS oError = ErrorNew() oError&#58;Severity = aErr&#91; nError &#93;&#91; ERR_SEVERITY &#93; oError&#58;CanDefault = oError&#58;Severity < ES_CATASTROPHIC oError&#58;SubSystem = If( aErr&#91; nError &#93;&#91; ERR_SUBSYS &#93; == nil,; _SUBSYS_ ,; aErr&#91; nError &#93;&#91; ERR_SUBSYS &#93; ) oError&#58;SubCode = If( aErr&#91; nError &#93;&#91; ERR_ERR_NO &#93; == nil,; nError,; aErr&#91; nError &#93;&#91; ERR_ERR_NO &#93; ) oError&#58;Description = aErr&#91; nError &#93;&#91; ERR_MESSAGE &#93; oError&#58;Operation = cOperation endif return oError [/code:p998h0oo] XLSFunc.prg [code:p998h0oo] // Compatibility XLS functions //#define _MSLINK_ #ifdef _MSLINK_ // Funct&#46; cells function xlsCELL(); return 1 function xlsSUM(); return 1 function xlsMULT(); return 1 // Funct&#46; Math&#46; function xlsABS(); return 1 function xlsINTE(); return 1 function xlsMOD(); return 1 function xlsROUND(); return 1 function xlsSIGN(); return 1 function xlsSQRT(); return 1 function xlsEXP(); return 1 function xlsLN(); return 1 function xlsLOG(); return 1 function xlsPI(); return 1 function xlsRANDOM(); return 1 function xlsSIN(); return 1 function xlsCOS(); return 1 function xlsTAN(); return 1 function xlsASIN(); return 1 function xlsACOS(); return 1 function xlsATAN(); return 1 #else // Funct&#46; cells function _CELL(); return 1 function _SUM(); return 1 function _MULT(); return 1 // Funct&#46; Math&#46; function _ABS(); return 1 function _INTE(); return 1 function _MOD(); return 1 function _ROUND(); return 1 function _SIGN(); return 1 function _SQRT(); return 1 function _EXP(); return 1 function _LN(); return 1 function _LOG(); return 1 function _PI(); return 1 function _RANDOM(); return 1 function _SIN(); return 1 function _COS(); return 1 function _TAN(); return 1 function _ASIN(); return 1 function _ACOS(); return 1 function _ATAN(); return 1 #endif [/code:p998h0oo]
¿Cómo enviar a Excel reporte con TPrinter?
Mr.Antonio, Muchas gracias. Ramon Paredes, ¿Me puede dar una muestra PRG muestra el uso de la clase Saludos Anser
¿Cómo enviar a Excel reporte con TPrinter?
Anserkk : Baja este archivo comprimido, ahi va ejemplo.prg donde te pongo dos ejemplos con filexls uno con un listado y uno con estadisticas y cuadros desde codigo, va ademas rgen1.dbf los datos de prueba y filexls.ch que no te lo habia proporcionado, el ejecutable que va ahi es el ejemplo compilado con fwh8.02 + xharboru 1.1., ojala te sea de utilidad <!-- m --><a class="postlink" href="http://www.megaupload.com/es/?d=TQB41T0Z">http://www.megaupload.com/es/?d=TQB41T0Z</a><!-- m --> Saludos desde Managua, Nicaragua Ramon Paredes
¿Cómo enviar a Excel reporte con TPrinter?
Ramon Paredes, Muchas gracias. Anser
¿Cómo enviar a Excel reporte con TPrinter?
Dear Ramon Paredes, Can you confirm that whether I need MS-Excel to be installed on the PC for the CLASS FileXLS to work ? In the sample which you have given I found that OLE "Excel.Application" is used, but in the CLASS FileXls I did not see any reference. I am looking for a CLASS which can create .XLS file, even if MS-Excel is not installed on the PC running the FWH application For Eg CLASS Txls but with more functionalities like your CLASS FileXLS. CLASS FileXLS has more fuctionalities in formatting and formulas ------------------------------------------ ¿Puede usted confirmar que si necesito MS-Excel debe estar instalado en el PC para la CLASS FileXLS para trabajar? En la muestra que usted ha dado en mi opinión, OLE "Excel.Application" se utiliza, pero en la CLASS FileXls no vi ninguna referencia. Estoy buscando una clase que puede crear. Archivo XLS, aunque MS-Excel no está instalado en el PC que ejecuta la aplicación FWH Por ejemplo, para la CLASS Txls pero con más funcionalidades que su FileXLS CLASS. CLASS FileXLS tiene más fuctionalities en formato y las fórmulas [code:2u8vqh6x]oExcel &#58;= TOleAuto()&#58;New( "Excel&#46;Application" ) oHoja &#58;= oExcel&#58;Get( "ActiveSheet" ) DEFINE XLS FORMAT nFormat1 PICTURE '#,##0' // para pesetas DEFINE XLS FORMAT nFormat2 PICTURE '#,##0&#46;00' // para euros XLS oFileXLS FILE "MAESTRO1&#46;XLS" //AUTOEXEC [/code:2u8vqh6x] Anser
¿Cómo enviar a Excel reporte con TPrinter?
anserkk : Esta clase crea hoja xls sin necesidad de tener instalado excel, es una de las ventajas, ahora sus funcionalidades estan limitadas hasta donde su autor las dejo, nadie ha ampliado la misma, hasta donde tengo entendido, es muy agil para reportes que no demanden muchos retoques, Slaudos desde Managua, Nicaragua Ramon Paredes
¿Cómo enviar a Excel reporte con TPrinter?
Dear Ramon Paredes, [quote:2t88r3br]Esta clase crea hoja xls sin necesidad de tener instalado excel[/quote:2t88r3br] Muchas gracias Saludos Anser
¿Cómo enviar a Excel reporte con TPrinter?
He encontrado una solución usando TPrinter para enviar directamente a Excel sin ir al previo Usa TFileXls junto con estos programas. Sin embargo hay que adicionar en el reporte lo siguiente: If lExcel If lPrevio PRINT oPrn NAME cDoc PREVIEW SELECTION Else PRINT oPrn NAME cDoc Endif Else If lPrevio PRINT oPrn NAME cDoc PREVIEW Else PRINT oPrn NAME cDoc Endif Endif Tambien es necesario agregar If lExcel Else If nFil > 26.5 nFil := 1 Es Todo // programa TMPRINTER #Include "FiveWin.ch" #include "FileXLS.ch" Static oPrinter CLASS TMPrinter FROM TPrinter DATA lSalida AS LOGICAL INIT .T. DATA bPreInit DATA oSalida DATA nRow DATA nCol Data cDoc DATA lFin AS LOGICAL INIT .F. //Redefiniendo Methods METHOD New( cDoc, lUser, lPreview, cModel, lModal, lSelection ) CONSTRUCTOR METHOD Activate() METHOD CmSay( nCol, xText, nFont, nPad, nRow ) METHOD Stabilize() METHOD End() METHOD SayBitmap( nRow, nCol, cBitmap, nWidth, nHeight, nScale ) METHOD Box( nRow, nCol, nBottom, nRight, nPen, nScale ) METHOD Line( nTop, nLeft, nBottom, nRight, nPen, nScale ) METHOD Shadow( nHeight ) METHOD Grid( nHeight, nRow, cChar ) METHOD Separator( nPen, nRow ) ENDCLASS METHOD New( cDoc, lUser, lPreview, cModel, lModal, lSelection ) CLASS TMPrinter Local uReturn // := Super:New( cDoc, lUser, lPreview,, lModal, lSelection ) PUBLIC lFin := .F. PUBLIC nRow DEFINE FONT oFont NAME "Arial" SIZE 0,-11 If ::lSalida // := .T. cDocumento := cDoc ::oSalida := TSalPrinterXls():New( Self, AllTrim( Left( cDocumento, 8 ) ) + '.xls' ) Else uReturn := Super:New( cDoc, lUser, lPreview,, lModal, lSelection ) Endif Return Self METHOD Activate() CLASS TMPrinter Local oPagina Local hActWnd := GetActiveWindow() ::hOldRes := GetResources() #ifdef __CLIPPER__ SET RESOURCES TO "preview.dll" #else SET RESOURCES TO "prev32.dll" #endif If GetResources() < 32 #ifdef __CLIPPER__ MsgStop( "Preview.dll not found", "Error" ) #else MsgStop( "Prev32.dll not found", "Error" ) #endif SetResources(::hOldRes) RETU NIL EndIf // Estabilizar el listado IF !::lCreated ::End() RETU NIL ENDIF ::Stabilize() IF !::lStable ::End() RETURN NIL ENDIF Return Nil METHOD CmSay( nRow, nCol, xText, oFont, nWidth, nClrText, nBkMode, nPad ) CLASS TMPrinter Local cPicture1 := "@!", cPicture2 := "@99,999,999.99", nFont := oFont:nHeight If ::lSalida nRow := Int( Round( ( nRow * 10 / 3)+0.5, 1 ) ) nCol := Int( Round(nCol+0.5,1) ) // Int( Round( ( nCol * 125 / 25.5 )+0.5,1 )) nRow2 := nRow // MsgInfo(Str(nRow)+"<<>>"+Str(nCol)) ::oSalida:Say( nCol, xText, nFont, nPad, nRow, cPicture1 ) Else If ValType( xText ) == 'N' .and. !Empty( cPicture2 ) xText:= Transform( xText, cPicture2 ) EndIf Super:CmSay( nRow, nCol, xText, oFont, nWidth, nClrText, nBkMode, nPad ) EndIf Return Nil METHOD Stabilize() CLASS TMPrinter If ::lSalida ::oSalida:Stabilize() Else Super:Stabilize() EndIf Return Nil METHOD End() CLASS TMPrinter If ::lSalida ::oSalida:Save() Else Endif Return Nil METHOD SayBitmap( nRow, nCol, cBitmap, nWidth, nHeight, nScale ) CLASS TMPrinter If ::lSalida // Else Super:SayBitmap( nRow, nCol, cBitmap, nWidth, nHeight, nScale ) EndIf Return Nil METHOD Box( nRow, nCol, nBottom, nRight, nPen, nScale ) CLASS TMPrinter If ::lSalida // Else Super:Box( nRow, nCol, nBottom, nRight, nPen, nScale ) EndIf Return Nil METHOD Line( nTop, nLeft, nBottom, nRight, nPen, nScale ) CLASS TMPrinter If ::lSalida // Else Super:Line( nTop, nLeft, nBottom, nRight, nPen, nScale ) EndIf Return Nil METHOD Shadow( nHeight ) CLASS TMPrinter If ::lSalida // Else Super:Shadow( nHeight ) EndIf Return Nil METHOD Grid( nHeight, nRow, cChar ) CLASS TMPrinter If ::lSalida // Else Super:Grid( nHeight, nRow, cChar ) EndIf Return Nil METHOD Separator( nPen, nRow ) CLASS TMPrinter If ::lSalida // Else Super:Separator(nPen, nRow) EndIf Return Nil Function PrintBegin( cDoc, lUser, lPreview, xModel, lModal, lSelection ) local aPrn local cText, cDevice local nScan PUBLIC lSalid2 lSalid2 := lSelection If lSelection if xModel == nil return oPrinter := TMPrinter():New( cDoc, lUser, lPreview,, lModal, lSelection ) endif cText := StrTran( GetProfString( "Devices" ),Chr(0), chr(13)+chr(10)) aPrn := Array( Mlcount( cText, 250 ) ) Aeval(aPrn, {|v,e| aPrn[e] := Trim(Memoline(cText, 250, e)) } ) if Valtype(xModel) == "N" if xModel < 0 .or. xModel > len(aPrn) nScan := 0 else nScan := xModel endif else if ( nScan := Ascan( aPrn, {|v| Upper( xModel ) == Upper( v ) } ) ) == 0 nScan = Ascan( aPrn, {|v| Upper( xModel ) $ Upper( v ) } ) endif endif if nScan == 0 MsgBeep() return oPrinter := TMPrinter():New( cDoc, .T., lPreview,, lModal, lSelection ) endif cText := GetProfString( "Devices", aPrn[ nScan ] ) cDevice := aPrn[ nScan ] + "," + cText Else if xModel == nil return oPrinter := TPrinter():New( cDoc, lUser, lPreview,, lModal, lSelection ) endif cText := StrTran( GetProfString( "Devices" ),Chr(0), chr(13)+chr(10)) aPrn := Array( Mlcount( cText, 250 ) ) Aeval(aPrn, {|v,e| aPrn[e] := Trim(Memoline(cText, 250, e)) } ) if Valtype(xModel) == "N" if xModel < 0 .or. xModel > len(aPrn) nScan := 0 else nScan := xModel endif else if ( nScan := Ascan( aPrn, {|v| Upper( xModel ) == Upper( v ) } ) ) == 0 nScan = Ascan( aPrn, {|v| Upper( xModel ) $ Upper( v ) } ) endif endif if nScan == 0 MsgBeep() return oPrinter := TPrinter():New( cDoc, .T., lPreview,, lModal, lSelection ) endif cText := GetProfString( "Devices", aPrn[ nScan ] ) cDevice := aPrn[ nScan ] + "," + cText Endif Return If(lSelection,oPrinter := TMPrinter():New( cDoc, .f., lPreview, cDevice, lModal, lSelection ),oPrinter := TPrinter():New( cDoc, .f., lPreview, cDevice, lModal, lSelection )) Function PageBegin() If lSalid2 // Else oPrinter:StartPage() Endif Return nil Function PageEnd() If lSalid2 // nRow debe continuar incrementandose Else oPrinter:EndPage() Endif Return nil Function PrintEnd() If lSalid2 oPrinter:End() // hay error al ejecutar esta opción. Else if oPrinter:lMeta oPrinter:Preview() else oPrinter:End() Endif oPrinter := nil Endif Return nil // TSalPrinter #include "FileXLS.ch" #include "FiveWin.ch" #include "Report.ch" CLASS TSalPrinterXLS DATA oPrn DATA oXls DATA cFile DATA aFont DATA aFormat DATA nRow METHOD New( ) CONSTRUCTOR METHOD Save() // METHOD StartPage() // METHOD EndPage() METHOD Stabilize() METHOD Say( nCol, xText, nFont, nPad, nRow, cPicture ) ENDCLASS METHOD New( oPrn, cFile ) CLASS TSalPrinterXLS DEFAULT cFile:= "MyFile.xls" ::aFont := {} ::aFormat:= {} ::cFile := cFile ::oPrn := oPrn ::nRow := 0 ::oXls := TFileXLS():New( ::cFile, , , .F., .T. ) // cFileName,lAutomatic,nIterations,lProtect,lAutoexec,oWnd Return Self METHOD Save() CLASS TSalPrinterXLS MsgRun( "Generando Arquivo Excel.... espere ", , {|| ::Stabilize() } ) SET XLS TO DISPLAY ; OF ::oXLS ::oXLS:End() RETURN Self METHOD Stabilize() CLASS TSalPrinterXLS RETURN Nil METHOD Say( nCol, xText, nFont, nPad, nRow, cPicture ) CLASS TSalPrinterXLS LOCAL uVal, ; nAlignamen := 0, ; nFormat := 0 DEFAULT xText := '', ; nFont := 1, ; nPad := RPT_LEFT // nFont:= ::cFont( nFont ) DO CASE CASE nPad == RPT_LEFT nAlignament := ALING_LEFT CASE nPad == RPT_RIGHT nAlignament := ALING_RIGHT CASE nPad == RPT_CENTER nAlignament := ALING_CENTER ENDCASE // IF !empty( cPicture ) // nFormat := 0 // ::cFormat( cPicture, valtype( xText ) ) // ENDIF LineadeStatus(Str(nRow)+"--"+str(nCol)+"->"+Alltrim(xText)+Str(nFont),4) @ nRow, nCol XLS SAY xText OF ::oXLS ; FONT nFont ; // FORMAT nFormat ; ALIGNAMENT nAlignament Return Nil Es todo Manuel J. Morales Q. Lima Perú
¿Cómo exportar listados DBF o Excel?
Hola <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Pues nada, que tengo que poder exportar los listados de mi aplicación a Excel o a una DBF (preferiblemente a Excel). ¿Alguna forma o idea? Gracias a todos <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> y un saludo
¿Cómo exportar listados DBF o Excel?
esta es mi forma ( al la vieja..... ) Function Dbf2Excel( oPadre, cFileDbf, lSQL, cOtraTabla, aOtrosCampos ) Local hExcel, oDDEs Local Planilla, aNuevo, cCelda, xValor Local cFileXls := Spac(250) Local j, nRegistros, nCampos Local cEjecut := "C:\MSOFFICE\EXCEL\Excel.Exe" Local i := 0 Local lCerrarExcel := .F. Local aTareas := GetTasks() Local hStmt := 0 Local TMaes := {} Local aResult := {} Local nOpcion := 0 Local xCampos Local qq := Chr(34) MEMVAR DEFATMP DEFAULT lSQL := .F. If aScan( aTareas, {|x| "EXCEL.EXE" $ Upper(x) } ) > 0 * excel ya fue cargado en memoria MsgStop(OemToAnsi("Debe cerrar Excel para realizar este proceso y luego continuar"),; "Error de Operador") Return NIL EndIf If !MsgGet( "Grabar en Archivo Excel...",; OemToansi("Nombre de Salida (sin extension .xls)"),; @cFileXls ) Return NIL EndIf cFileXls := AllTrim( cFileXls ) If File( cFileXls ) MsgStop("Nombre de archivo ya existe...","Error de Operador") Return NIL ElseIf Empty( cFileXls ) MsgStop("Nombre de archivo no corresponde...","Error de Operador") Return NIL EndIf * parece que esta bueno cFileXls := DEFATMP+"\"+cFileXls+".Xls" SysRefresh() oPadre:bDdeInit := {|hWndClient, cAppName, cTopicName| MsgBeep() } oPadre:bDdeExecute := {|hWndClient, cCommand | &(cCommand) } DEFINE DDE oDDEs ; SERVICE "Excel" ; TOPIC "System" If aScan( aTareas, {|x| "EXCEL.EXE" $ Upper(x) } ) == 0 lCerrarExcel := .T. If ( hExcel:= WinExec( cEjecut, <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) --> ) < 32 If hExcel > 0 MsgStop( "Excel no cargado..." ) Return Nil Endif EndIf Else lCerrarExcel := .F. * excel ya fue cargado en memoria EndIf hExcel := GetWndTask(1) If hExcel = Nil MsgInfo( "Programa Excel no encontrado") Return Nil Endif ACTIVATE DDE oDDEs CursorWait() Select (cFileDbf) COPY TO _Dbf2Xls oDDEs:Execute("[Open(" +qq+ DEFATMP+"\_Dbf2Xls.Dbf" +qq+ ")]") oDDEs:Execute( "[Save.As(" +qq+ cFileXls +qq+ ",1)]" ) If lCerrarExcel SendMessage( hExcel, WM_DESTROY ) EndIf oDDEs:End() oDDEs := Nil CursorArrow() Borrar( "_Dbf2Xls.dbf" ) Return NIL //----------------------------------- ademas viktor tomas tiene una clase re-buena para hacer conexion con excel, creo que se llama TFILEXLS. Saludos y espero te sirva.
¿Cómo exportar listados DBF o Excel?
Hola <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Muchas muchas gracias por la superrespuesta. Solo una cosa ¿Que es DDE? Un saludo <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
¿Cómo exportar listados DBF o Excel?
de lo que entiendo es Dinamic Data Exchange, o intercambio dinamico de datos.... ahora saber que es exactamente...mmmm dificil. se que lo hace y eso me deja tranquilo un rato. Saludos
¿Cómo exportar listados DBF o Excel?
DDE = Dynamic Data Exchange. Intercambio Dinámico de Datos. Conjunto de especificaciones de Microsoft para el intercambio de datos y control de flujo entre aplicaciones. Saludos
¿Cómo exportar listados DBF o Excel?
Si estas trabajando a 16 bits utiliza la FileXLS de Ramon Avendaño, te genera archivos XLS nativos de Excel sin necesidad de DDE ni de OLE, es mas, no necesitas tener ni siquiera excel instalado.
¿Cómo exportar listados DBF o Excel?
OK, ya veo lo de DDE pero supongo que es necesaria una librería al respecto ¿o no? Muchisimas gracias a todos y un saludo <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
¿Cómo exportar listados DBF o Excel?
Manuel, El DDE lo proporciona Windows automaticamente, de todas maneras, como te indica René, lo idóneo es usar la clase de Ramón que te evita tener que usar DDE, tener Excel instalado, etc. Pero ambas soluciones te servirán.
¿Cómo hacer algunas cosas en XBrowse?
Amigos del foro, tengo la siguiente duda, tengo un diálogo con xBrowse, y necesito que al llegar al xbrowse, el último get me active el get del method de xbrowse. He probador varias formas, pero realmente, creo que se me ha quedado grande ahora. [code=fw:25c8y4ii]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oWnd, aLin := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>, i, oBrw, lValid := .F., lRet<br /><br />   <span style="color: #00C800;">for</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">6</span><br />      AAdd<span style="color: #000000;">&#40;</span> aLin, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Description "</span> + Str<span style="color: #000000;">&#40;</span> i <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">next</span><br />                                                                                    <span style="color: #000000;">1</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br />      oBrw := TxBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oWnd <span style="color: #000000;">&#41;</span><br /><br />      oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aLin <span style="color: #000000;">&#41;</span><br /><br />      oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span>      := <span style="color: #ff0000;">'Description'</span><br /><br />      oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOnPostEdit</span>  := <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, aLin<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := xVal,<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />      oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bEditValid</span>   := <span style="color: #000000;">&#123;</span> | oGet, oCol | MiValid<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">Value</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />      oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span>    := EDIT_GET<br /><br />      oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />      oWnd:<span style="color: #000000;">oClient</span>:=oBrw<br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br />RETU <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">Function</span> MiValid<span style="color: #000000;">&#40;</span> cValue <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> lRet := .T.<br /><br />   <span style="color: #00C800;">if</span> AllTrim<span style="color: #000000;">&#40;</span> cValue <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"123"</span><br />      lRet = .F.<br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> lRet</div>[/code:25c8y4ii] Algo así es lo que pretendo, pero con un modo de autoedición, que no es equivalente al FastEdit, además, lo hago con un Redefine.
¿Cómo hacer algunas cosas en XBrowse?
Esto me lo paso un colega, me funciona bien, estoy haciendo lo mismo que tu, facturacion con xBRWOSE, espero te sirva... REDEFINE GET oGetF2[1] VAR oFVentas:oDbfFACVTA:fac_codcli; // CODIGO CLIENTE ID 201 OF oFVentas:oFldVENTAS:aDialogs[2] UPDATE PICTURE "@!" ; VALID (oFVentas:oBrwVENTAS:SetFocus(),__keyboard(chr(13)),.t.) // PARA DAR FOCUS A LA PRIMERA COLUMNA DE xBROWSE...
¿Cómo hago para agrupar columnas en TWbrowse?
Estimados, Necesito agrupar columnas en un twbrowse, como se hace? Ejemplo: [code:2gwmo7b8] | STOCK | | minimo | maximo |[/code:2gwmo7b8] Gracias.
¿Cómo hago para agrupar columnas en TWbrowse?
Goost Me parece que con esa clase no se puede ( por lo menos yo no lo pude resolver ). Si con TSBROWSE porque trae superheaders. Saludos