topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
oPrn PREVIEW en Apaisado pero imprime en Vertical | me pasa lo mismo cuando tengo el preview en visualización del Report, todo indica que esta en horizontal pero al mandar a imprimir sale en vertical <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> ..... la verdad no le había tomado importancia.... <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
oPrn PREVIEW en Apaisado pero imprime en Vertical | [quote="cnavarro":1z3euqve]Si no te funciona, intenta poniéndolo dentro de la clausula PAGE
[code=fw:1z3euqve]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /> <span style="color: #0000ff;">PAGE</span><br /> oPrn:<span style="color: #000000;">SetPage</span><span style="color: #000000;">(</span> <span style="color: #000000;">9</span> <span style="color: #000000;">)</span><br /> .../...<br /> </div>[/code:1z3euqve][/quote:1z3euqve]Funcionó, muchas gracias por la ayuda
Enviado desde mi MI 5 mediante Tapatalk |
oPrn:DraftMode( ) | Tratando de usar esta funcion, al parecer está algo mal....
Cuando la activo, me dibuja oPrn:Box y oPrn:RoundBox como 4 veces mas grande.. solamente Horizontalmente
El Brush se aumenta en los cuatro lados...
[code=fw:4tzr8ohk]<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: #00D7D7;">#define</span> DMPAPER_LETTER <span style="color: #000000;">1</span> <span style="color: #B900B9;">// Letter 8 1/2 x 11 in</span><br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> Reporte1<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">Function</span> Reporte1<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> nHeight, nWidth <br /> <span style="color: #00C800;">LOCAL</span> AvailHeight, AvailWidth<br /> <span style="color: #00C800;">LOCAL</span> nLeftMargin, nTopMargin, nRightMargin, nBottomMargin<br /> <span style="color: #00C800;">LOCAL</span> nHeaderHeight, nFooterHeight<br /> <span style="color: #00C800;">LOCAL</span> oBrush, oPen<br /> <br /> <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"PEDIDO DE VENTA"</span> PREVIEW<br /> oPrn:<span style="color: #000000;">SetPage</span><span style="color: #000000;">(</span>DMPAPER_LETTER<span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">DraftMode</span><span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span><br /><br /> nHeight := oPrn:<span style="color: #000000;">nVertRes</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> nWidth := oPrn:<span style="color: #000000;">nHorzRes</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> nLeftMargin := <span style="color: #000000;">(</span> nWidth / <span style="color: #000000;">17</span> <span style="color: #000000;">)</span><br /> nRightMargin := <span style="color: #000000;">(</span> nWidth - nLeftMargin <span style="color: #000000;">)</span><br /> nTopMargin := <span style="color: #000000;">(</span> nHeight / <span style="color: #000000;">22</span> <span style="color: #000000;">)</span><br /> nBottomMargin := <span style="color: #000000;">(</span> nHeight - nRightMargin <span style="color: #000000;">)</span><br /> <br /> nAvailHeight := <span style="color: #000000;">(</span> nHeight - <span style="color: #000000;">(</span> nTopMargin + nBottomMargin <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <br /> nRowStep = oPrn:<span style="color: #000000;">nVertRes</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> / <span style="color: #000000;">66</span> <br /> nColStep = oPrn:<span style="color: #000000;">nHorzRes</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> / <span style="color: #000000;">80</span> <br /> <br /> prow:=nRowStep<br /> pcol:=nColStep<br /> <br /> <span style="color: #0000ff;">PAGE</span><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">brush</span> oBrush <span style="color: #0000ff;">color</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">204</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">153</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen <span style="color: #0000ff;">STYLE</span> <span style="color: #000000;">0</span> WIDTH <span style="color: #000000;">8</span> <span style="color: #0000ff;">COLOR</span> CLR_GRAY<br /> <br /> oPrn:<span style="color: #000000;">Box</span><span style="color: #000000;">(</span> prow , nLeftMargin , prow + <span style="color: #000000;">1000</span> , nRightMargin , oPen, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">220</span>,<span style="color: #000000;">220</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <br /> oPrn:<span style="color: #0000ff;">EndPage</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #0000ff;">ENDPRINT</span><br /> <br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /> <br /> <br /> </div>[/code:4tzr8ohk] |
oPrn:ImportWMF() | Antonio,
after the last modification to ImportWMF() introduced with the March build, the function works ok in XP, either with WMF or with EMF files, but in Windows 98 both the file types are loaded incorrectly.
Please have a look at the modified corel.prg sample I've sent to your private mailbox.
Thank you,
Davide. |
oPrn:ImportWMF() | Davide,
In Class TPrinter Method ImportWMF() try these two possibilities:
[code:37030bbl]
::SetIsoTropicMode()
::SetWindowExt( GetDeviceCaps( ::hDC, HORZRES ),;
GetDeviceCaps( ::hDC, VERTRES ) )
::SetViewPortExt( GetDeviceCaps( ::hDC, HORZRES ),;
GetDeviceCaps( ::hDC, VERTRES ) )
[/code:37030bbl]
or
[code:37030bbl]
::SetIsoTropicMode()
::SetWindowExt( aData[ 1 ], aData[ 2 ] )
::SetViewPortExt( aData[ 1 ], aData[ 2 ] )
[/code:37030bbl] |
oPrn:ImportWMF() | Davide,
In XP if you double click on the EMF file, the XP graphics viewer reports that there is an error on the EMF file. Paint Shop Pro also refuses to open it. |
oPrn:ImportWMF() | Antonio,
[quote:2dj6fiqi]In XP if you double click on the EMF file, the XP graphics viewer reports that there is an error on the EMF file. Paint Shop Pro also refuses to open it.[/quote:2dj6fiqi]
I've seen it. I've created the EMF with OpenOffice, starting from the WMF one. In W98 they are both opened correctly with ACDSee.
Anyway, I'm particularly worried about the WMF, for backward compatibility. I'll try your suggestions and I'll let you know.
Thanks,
Davide. |
oPrn:ImportWMF() | Antonio,
[code:2et0moer]
::SetIsoTropicMode()
::SetWindowExt( GetDeviceCaps( ::hDC, HORZRES ),;
GetDeviceCaps( ::hDC, VERTRES ) )
::SetViewPortExt( GetDeviceCaps( ::hDC, HORZRES ),;
GetDeviceCaps( ::hDC, VERTRES ) )
[/code:2et0moer]
Same behaviour. Anyway, it doesn't seem related to the size of printer object because the image itself is "mixed", as you can see in the screenshot I've sent you.
[code:2et0moer]
::SetIsoTropicMode()
::SetWindowExt( aData[ 1 ], aData[ 2 ] )
::SetViewPortExt( aData[ 1 ], aData[ 2 ] )
[/code:2et0moer]
It's already implemented this way, anyway I recompiled and relinked printer.prg, but nothing changes.
It seems that I've found a strange image however, because I tried other old WMF's and they works ok in Windows98 too.
The funny thing is that this image is working ok with XP and always worked well with previous FWH and FW versions in 98 too.
Thank you,
Davide. |
oPrn:ImportWMF() | Davide,
You may try to rebuild that file again to see if it gets fixed. |
oPrn:ImportWMF() | Antonio,
[quote="Antonio Linares":39s7wu3c]You may try to rebuild that file again to see if it gets fixed.[/quote:39s7wu3c]
I tried the WMF on another W98 machine. Same behaviour.
I reopened the WMF with CorelDraw (which displays it correctly) and reexported it as a WMF file. Same behaviour.
The original WMF worked well in past, and it works ok in XP even now, with FWH27-3, so I guess it may be related to the changes made in FWH to use EMF files instead of WMF. I'm going to make a test with FWH25 anyway. I'll let you know.
Thank you,
Davide. |
oPrn:ImportWMF() | thanks, |
oPrn:ImportWMF() | Antonio,
I confirm you the original WMF works ok with FWH25 in Windows98.
The problem may be related to the WMF2EMF() function in 98.
Hi,
Davide. |
oPrn:ImportWMF() | Davide,
We just use standard Win32 functions for WMF2EMF(). |
oPrn:ImportWMF() | Antonio,
[quote="Antonio Linares":3m72jp1s]We just use standard Win32 functions for WMF2EMF().[/quote:3m72jp1s]
well, I really don't know why it worked before and it does not work well now. It was only a guess/suggestion based on the tests I've made so far.
Thank you,
Davide. |
oPrn:RoundBox (solucionado) | Karinha
Muchas gracias por responder
[quote:hkrtxcke]echo %bcdir%\lib\cw32.lib + >> b32.bc
echo %bcdir%\lib\import32.lib + >> b32.bc
echo %bcdir%\lib\uuid.lib + >> b32.bc
echo %bcdir%\lib\ws2_32.lib + >> b32.bc
echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc
echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc
echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc
echo %bcdir%\lib\psdk\psapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\gdiplus.lib + >> b32.bc
echo %bcdir%\lib\psdk\iphlpapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\shell32.lib, >> b32.bc[/quote:hkrtxcke]
Este es mi archivo de entorno
[code=fw:hkrtxcke]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #000000;">[</span>Environment<span style="color: #000000;">]</span><br />Description <span style="color: #000000;">1</span>=Xharbour <span style="color: #000000;">1.2</span><span style="color: #000000;">.1</span> y FWH <span style="color: #000000;">11.08</span><br />Description <span style="color: #000000;">2</span>=<br />Description <span style="color: #000000;">3</span>=<br />PRG Compiler ver=<span style="color: #000000;">1.2</span><span style="color: #000000;">.1</span><br />C compiler ver=<span style="color: #000000;">5.82</span><br />Subsystem=<br />Last <span style="color: #0000ff;">update</span>=<span style="color: #000000;">10</span>/<span style="color: #000000;">06</span>/<span style="color: #000000;">2011</span><br /><br /><span style="color: #000000;">[</span>Advanced<span style="color: #000000;">]</span><br />Command types=<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span><br /><br /><span style="color: #000000;">[</span>Harbour<span style="color: #000000;">]</span><br />HB_INSTALL=p:\32bits\<span style="color: #000000;">11.08</span>\xHarbour<br />HB_COMMAND=%HB_BIN_INSTALL%\Harbour.Exe %PRG% /m /n /es2 /i%HB_INC_INSTALL%<br />Option prefix=/<br /><br /><span style="color: #000000;">[</span>C<span style="color: #000000;">]</span><br />C_INSTALL=p:\32bits\Borland\bcc582<br />C_COMP_COMMAND=%C_BIN_INSTALL%\Bcc32.Exe -M -c -v -O2 -I%HB_INC_INSTALL% -I%C_INC_INSTALL% -n%HOME%\Obj %C%<br />C_LIB_COMMAND=%C_BIN_INSTALL%\TLib.Exe %LIB% /P512 @%RSP% , %LST%<br />C_LINK_COMMAND=%C_BIN_INSTALL%\iLink32.Exe -Gn -aa -Tpe -s -v @%LNK%<br />C_RC_COMMAND=%C_BIN_INSTALL%\Brc32.Exe -r -fo%RES% %RC%<br />C_DLL_COMMAND=<br />Option prefix=-<br /><br /><span style="color: #000000;">[</span>User<span style="color: #000000;">]</span><br />POSTEXE_COMMAND=<br />POSTLIB_COMMAND=<br />POSTDLL_COMMAND=<br /><br /><span style="color: #000000;">[</span>Files<span style="color: #000000;">]</span><br />%C_LIB_INSTALL%\C0W32.OBJ=<span style="color: #000000;">1</span><br />P:\32bits\<span style="color: #000000;">11.08</span>\FWH\lib\Fivehx.lib=<span style="color: #000000;">2</span><br />P:\32bits\<span style="color: #000000;">11.08</span>\FWH\lib\Fivehc.lib=<span style="color: #000000;">3</span><br />%HB_LIB_INSTALL%\rtl.lib=<span style="color: #000000;">4</span><br />%HB_LIB_INSTALL%\vm.lib=<span style="color: #000000;">5</span><br />%HB_LIB_INSTALL%\gtgui.lib=<span style="color: #000000;">6</span><br />%HB_LIB_INSTALL%\lang.lib=<span style="color: #000000;">7</span><br />%HB_LIB_INSTALL%\macro.lib=<span style="color: #000000;">8</span><br />%HB_LIB_INSTALL%\rdd.lib=<span style="color: #000000;">9</span><br />%HB_LIB_INSTALL%\dbfcdx.lib=<span style="color: #000000;">10</span><br />%HB_LIB_INSTALL%\dbfntx.lib=<span style="color: #000000;">11</span><br />%HB_LIB_INSTALL%\dbffpt.lib=<span style="color: #000000;">12</span><br />%HB_LIB_INSTALL%\hbsix.lib=<span style="color: #000000;">13</span><br />%HB_LIB_INSTALL%\common.lib=<span style="color: #000000;">14</span><br />%HB_LIB_INSTALL%\pp.lib=<span style="color: #000000;">15</span><br />%HB_LIB_INSTALL%\pcrepos.lib=<span style="color: #000000;">16</span><br />%C_LIB_INSTALL%\cw32.lib=<span style="color: #000000;">17</span><br />%C_LIB_INSTALL%\import32.lib=<span style="color: #000000;">18</span><br />%C_LIB_INSTALL%\uuid.lib=<span style="color: #000000;">19</span><br />%C_LIB_INSTALL%\PSDK\odbc32.lib=<span style="color: #000000;">20</span><br />%C_LIB_INSTALL%\PSDK\rasapi32.lib=<span style="color: #000000;">21</span><br />%C_LIB_INSTALL%\PSDK\iphlpapi.lib=<span style="color: #000000;">22</span><br />%C_LIB_INSTALL%\PSDK\msimg32.lib=<span style="color: #000000;">23</span><br />%C_LIB_INSTALL%\PSDK\nddeapi.lib=<span style="color: #000000;">24</span><br />%HB_LIB_INSTALL%\ct.lib=<span style="color: #000000;">25</span><br />%C_LIB_INSTALL%\PSDK\psapi.lib=<span style="color: #000000;">26</span><br />%HB_LIB_INSTALL%\codepage.lib=<span style="color: #000000;">27</span><br /><br /><span style="color: #000000;">[</span>DLL Files<span style="color: #000000;">]</span><br />%C_LIB_INSTALL%\C0W32.OBJ=<span style="color: #000000;">1</span><br />%HB_LIB_INSTALL%\rtl.lib=<span style="color: #000000;">2</span><br />%HB_LIB_INSTALL%\vm.lib=<span style="color: #000000;">3</span><br />%HB_LIB_INSTALL%\gtgui.lib=<span style="color: #000000;">4</span><br />%HB_LIB_INSTALL%\lang.lib=<span style="color: #000000;">5</span><br />%HB_LIB_INSTALL%\macro.lib=<span style="color: #000000;">6</span><br />%HB_LIB_INSTALL%\rdd.lib=<span style="color: #000000;">7</span><br />%HB_LIB_INSTALL%\dbfntx.lib=<span style="color: #000000;">8</span><br />%HB_LIB_INSTALL%\dbfcdx.lib=<span style="color: #000000;">9</span><br />%HB_LIB_INSTALL%\dbfdbt.lib=<span style="color: #000000;">10</span><br />%HB_LIB_INSTALL%\common.lib=<span style="color: #000000;">11</span><br />%HB_LIB_INSTALL%\ct.lib=<span style="color: #000000;">12</span><br />%HB_LIB_INSTALL%\pp.lib=<span style="color: #000000;">13</span><br />%C_LIB_INSTALL%\CW32.LIB=<span style="color: #000000;">14</span><br />%C_LIB_INSTALL%\IMPORT32.LIB=<span style="color: #000000;">15</span><br /> </div>[/code:hkrtxcke]
Me puedes orientar ? |
oPrn:RoundBox (solucionado) | Por favor alquien que me ayude
Quiero poner una caja redondeada y me da el siguiente alert
Error code: 0 loading GDI:EXE
Este es mi codigo ( el codigo lo tome del foro)
[code=fw:zedequ5b]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> CajaRed<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oPrn<br /> <span style="color: #00C800;">LOCAL</span> oPen<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush <span style="color: #0000ff;">COLOR</span> CLR_BLACK<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oFondo <span style="color: #0000ff;">COLOR</span> CLR_HGRAY<br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen WIDTH <span style="color: #000000;">2</span><br /><br /><br /> <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">FROM</span> USER PREVIEW <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Ejemplo de caja redondeada"</span><br /><br /> <span style="color: #0000ff;">PAGE</span><br /><br /> CajaRound<span style="color: #000000;">(</span> <span style="color: #000000;">1.6</span> , <span style="color: #000000;">15.0</span> , <span style="color: #000000;">3.4</span>, <span style="color: #000000;">20.0</span>, oPrn, <span style="color: #000000;">90</span>, <span style="color: #000000;">90</span>, oPen, oBrush <span style="color: #000000;">)</span> <span style="color: #B900B9;">//*nRGB(250,213,174*/) )</span><br /><br /> <span style="color: #0000ff;">ENDPAGE</span><br /><br /> oPen:<span style="color: #000000;">END</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oPen:<span style="color: #0000ff;">release</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ENDPRINT</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">Function</span> CajaRound<span style="color: #000000;">(</span>nArriba, nIzq, nAbajo, nDerecha, oPrn, a, b, oPen, oBrush<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> hOldPen, xCor := <span style="color: #000000;">{</span><span style="color: #000000;">}</span> , yCor := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> hOldBrush<br /> <span style="color: #B900B9;">// Pasamos coordenadas de cms a pixel</span><br /> xCor := oPrn:<span style="color: #000000;">Cmtr2Pix</span><span style="color: #000000;">(</span>nArriba,nIzq<span style="color: #000000;">)</span><br /> yCor := oPrn:<span style="color: #000000;">Cmtr2Pix</span><span style="color: #000000;">(</span>nAbajo,nDerecha<span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// Guardamos el Lapiz y la brocha que teniamos</span><br /> hOldPen := SelectObject<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDcOut</span>, oPen:<span style="color: #000000;">hPen</span> <span style="color: #000000;">)</span><br /> hOldBrush := SelectObject<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDcOut</span>, oBrush:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//Dibujamos el rectangulo redondeado</span><br /> roundrect<span style="color: #000000;">(</span>oPrn:<span style="color: #000000;">hdcOut</span>,xCor<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>,xCor<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>,yCor<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>,yCor<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>,a,b<span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// y seleccionamos el que habiamos guardado</span><br /> selectObject<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDcOut</span>, hOldPen <span style="color: #000000;">)</span><br /> selectObject<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDcOut</span>, hOldBrush <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:zedequ5b] |
oPrn:RoundBox (solucionado) | [url:26laazrp]http://imgur.com/hlU4zUq[/url:26laazrp]
[img:26laazrp]http://i.imgur.com/hlU4zUq.png[/img:26laazrp] |
oPrn:RoundBox (solucionado) | [code=fw:vlq13y1c]<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;">FUNCTION</span> CajaRed<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oPrn<br /> <span style="color: #00C800;">LOCAL</span> oPen<br /> <span style="color: #00C800;">LOCAL</span> oBrush<br /> <span style="color: #00C800;">LOCAL</span> oFondo<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush <span style="color: #0000ff;">COLOR</span> CLR_BLACK<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oFondo <span style="color: #0000ff;">COLOR</span> CLR_HGRAY<br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen WIDTH <span style="color: #000000;">2</span><br /><br /> <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">FROM</span> USER PREVIEW <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Ejemplo de caja redondeada"</span><br /><br /> <span style="color: #0000ff;">PAGE</span><br /><br /> CajaRound<span style="color: #000000;">(</span> <span style="color: #000000;">1.6</span> , <span style="color: #000000;">15.0</span> , <span style="color: #000000;">3.4</span>, <span style="color: #000000;">20.0</span>, oPrn, <span style="color: #000000;">90</span>, <span style="color: #000000;">90</span>, oPen, oBrush <span style="color: #000000;">)</span> <span style="color: #B900B9;">//*nRGB(250,213,174*/) )</span><br /><br /> <span style="color: #0000ff;">ENDPAGE</span><br /><br /> <span style="color: #0000ff;">ENDPRINT</span><br /><br /> oBrush:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oFondo:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oPen:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oPen:<span style="color: #0000ff;">release</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Function</span> CajaRound<span style="color: #000000;">(</span>nArriba, nIzq, nAbajo, nDerecha, oPrn, a, b, oPen, oBrush<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> hOldPen, xCor := <span style="color: #000000;">{</span><span style="color: #000000;">}</span> , yCor := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> hOldBrush<br /> <span style="color: #B900B9;">// Pasamos coordenadas de cms a pixel</span><br /> xCor := oPrn:<span style="color: #000000;">Cmtr2Pix</span><span style="color: #000000;">(</span>nArriba,nIzq<span style="color: #000000;">)</span><br /> yCor := oPrn:<span style="color: #000000;">Cmtr2Pix</span><span style="color: #000000;">(</span>nAbajo,nDerecha<span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// Guardamos el Lapiz y la brocha que teniamos</span><br /> hOldPen := SelectObject<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDcOut</span>, oPen:<span style="color: #000000;">hPen</span> <span style="color: #000000;">)</span><br /> hOldBrush := SelectObject<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDcOut</span>, oBrush:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//Dibujamos el rectangulo redondeado</span><br /> roundrect<span style="color: #000000;">(</span>oPrn:<span style="color: #000000;">hdcOut</span>,xCor<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>,xCor<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>,yCor<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>,yCor<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>,a,b<span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// y seleccionamos el que habiamos guardado</span><br /> selectObject<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDcOut</span>, hOldPen <span style="color: #000000;">)</span><br /> selectObject<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDcOut</span>, hOldBrush <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:vlq13y1c] |
oPrn:RoundBox (solucionado) | [code=fw:3dptjsel]<div class="fw" id="{CB}" style="font-family: monospace;"><br />echo %bcdir%\lib\cw32.lib + >> b32.bc<br />echo %bcdir%\lib\import32.lib + >> b32.bc<br />echo %bcdir%\lib\uuid.lib + >> b32.bc<br />echo %bcdir%\lib\ws2_32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\psapi.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\gdiplus.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\iphlpapi.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\shell32.lib, >> b32.bc<br /> </div>[/code:3dptjsel]
Saludos. |
oPrn:RoundBox (solucionado) | Te falta: gdiplus.lib
Saludos. |
oPrn:RoundBox (solucionado) | Karinha
Muchas gracias por tus atenciones
Agregué a mi archivo de entorno gdiplus.lib como me indicaste pero el mensaje de error seguía
Despues de mucho buscar encontré la solución tomando un fragmento de codigo de la TUtilPrn de The Full
[code=fw:ie7584z3]<div class="fw" id="{CB}" style="font-family: monospace;">#IFDEF __HARBOUR__<br /> DLL <span style="color: #00C800;">FUNCTION</span> RoundRect<span style="color: #000000;">(</span> hDC AS LONG, ;<br /> iLeft AS _INT , iTop AS _INT, ;<br /> iRight AS _INT, iBottom AS _INT, ;<br /> iWidth AS _INT, iHeight AS _INT <span style="color: #000000;">)</span> AS BOOL PASCAL LIB <span style="color: #ff0000;">"GDI32.DLL"</span><br />#ELSE<br /> DLL <span style="color: #00C800;">FUNCTION</span> RoundRect<span style="color: #000000;">(</span> hDC AS WORD, ;<br /> iLeft AS _INT , iTop AS _INT, ;<br /> iRight AS _INT, iBottom AS _INT, ;<br /> iWidth AS _INT, iHeight AS _INT <span style="color: #000000;">)</span> AS BOOL PASCAL LIB <span style="color: #ff0000;">"GDI.EXE"</span><br />#ENDIF</div>[/code:ie7584z3]
Finalmente el codigo quedó asi por si le puede ser util a alguien mas
[code=fw:ie7584z3]<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> CajaRed<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oPrn<br /> <span style="color: #00C800;">LOCAL</span> oPen<br /> <span style="color: #00C800;">LOCAL</span> oBrush<br /> <span style="color: #00C800;">LOCAL</span> oFondo<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush <span style="color: #0000ff;">COLOR</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">250</span>,<span style="color: #000000;">213</span>,<span style="color: #000000;">174</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//CLR_BLACK</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oFondo <span style="color: #0000ff;">COLOR</span> CLR_HGRAY<br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen WIDTH <span style="color: #000000;">2</span><br /><br /> <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">FROM</span> USER PREVIEW <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Ejemplo de caja redondeada"</span><br /><br /> <span style="color: #0000ff;">PAGE</span><br /><br /> CajaRound<span style="color: #000000;">(</span> <span style="color: #000000;">1.6</span> , <span style="color: #000000;">2.0</span> , <span style="color: #000000;">3.4</span>, <span style="color: #000000;">20.0</span>, oPrn, <span style="color: #000000;">90</span>, <span style="color: #000000;">90</span>, oPen, oBrush <span style="color: #B900B9;">/*nRGB(250,213,174)*/</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ENDPAGE</span><br /><br /> <span style="color: #0000ff;">ENDPRINT</span><br /><br /> oBrush:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oFondo:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oPen:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oPen:<span style="color: #0000ff;">release</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Function</span> CajaRound<span style="color: #000000;">(</span>nArriba, nIzq, nAbajo, nDerecha, oPrn, a, b, oPen, oBrush <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> hOldPen, xCor := <span style="color: #000000;">{</span><span style="color: #000000;">}</span> , yCor := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> hOldBrush<br /> <span style="color: #B900B9;">// Pasamos coordenadas de cms a pixel</span><br /> xCor := oPrn:<span style="color: #000000;">Cmtr2Pix</span><span style="color: #000000;">(</span>nArriba,nIzq<span style="color: #000000;">)</span><br /> yCor := oPrn:<span style="color: #000000;">Cmtr2Pix</span><span style="color: #000000;">(</span>nAbajo,nDerecha<span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// Guardamos el Lapiz y la brocha que teniamos</span><br /> hOldPen := SelectObject<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDcOut</span>, oPen:<span style="color: #000000;">hPen</span> <span style="color: #000000;">)</span><br /> hOldBrush := SelectObject<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDcOut</span>, oBrush:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//Dibujamos el rectangulo redondeado</span><br /> roundrect<span style="color: #000000;">(</span>oPrn:<span style="color: #000000;">hdcOut</span>,xCor<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>,xCor<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>,yCor<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>,yCor<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>,a,b<span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// y seleccionamos el que habiamos guardado</span><br /> selectObject<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDcOut</span>, hOldPen <span style="color: #000000;">)</span><br /> selectObject<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDcOut</span>, hOldBrush <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br />#IFDEF __HARBOUR__<br /> DLL <span style="color: #00C800;">FUNCTION</span> RoundRect<span style="color: #000000;">(</span> hDC AS LONG, ;<br /> iLeft AS _INT , iTop AS _INT, ;<br /> iRight AS _INT, iBottom AS _INT, ;<br /> iWidth AS _INT, iHeight AS _INT <span style="color: #000000;">)</span> AS BOOL PASCAL LIB <span style="color: #ff0000;">"GDI32.DLL"</span><br />#ELSE<br /> DLL <span style="color: #00C800;">FUNCTION</span> RoundRect<span style="color: #000000;">(</span> hDC AS WORD, ;<br /> iLeft AS _INT , iTop AS _INT, ;<br /> iRight AS _INT, iBottom AS _INT, ;<br /> iWidth AS _INT, iHeight AS _INT <span style="color: #000000;">)</span> AS BOOL PASCAL LIB <span style="color: #ff0000;">"GDI.EXE"</span><br />#ENDIF</div>[/code:ie7584z3]
Saludos |
oPrn:RoundBox (solucionado) | Mui bién... Más,
[url:2392egem]http://forums.fivetechsupport.com/viewtopic.php?f=6&t=34256[/url:2392egem]
Yo uso FWHX17.01 y compila bién como puedes veer en la imagen.
Saludos. |
oPrn:RoundBox() (SOLUCIONADO) | Estoy intentando usar esta función:
[code=fw:2i3vlfrw]<div class="fw" id="{CB}" style="font-family: monospace;">oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> nLeftMargin , prow , nRightMargin , prow + <span style="color: #000000;">1000</span> , oPen, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">220</span>,<span style="color: #000000;">220</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span></div>[/code:2i3vlfrw]
Por su nombre y parámetros esperaba que me diera algo diferente:
Me tira una caja cuadrada, no redonda
Las coordenadas las tiene al reves, (diferente que oPrn:Box al menos)
No usa el PEN proporcionado
Acepta color, pero no lo tira por ningún lado...
Alguien podría explicarme que estoy haciendo mal, por favor.... |
oPrn:RoundBox() (SOLUCIONADO) | Bayron:
[code=fw:11brt42o]<div class="fw" id="{CB}" style="font-family: monospace;"><br />CajaRound<span style="color: #000000;">(</span> <span style="color: #000000;">1.6</span> , <span style="color: #000000;">15.0</span> , <span style="color: #000000;">3.4</span>, <span style="color: #000000;">20.0</span> ,oPrn,<span style="color: #000000;">90</span>,<span style="color: #000000;">90</span>,oPen1,nRGB<span style="color: #000000;">(</span><span style="color: #000000;">250</span>,<span style="color: #000000;">250</span>,<span style="color: #000000;">250</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br />Func CajaRound<span style="color: #000000;">(</span>nArriba, nIzq, nAbajo, nDerecha, oPrn, nAncho, nAlto, oPen, nColor <span style="color: #000000;">)</span> <br /><span style="color: #00C800;">Local</span> xCor := <span style="color: #000000;">{</span><span style="color: #000000;">}</span> , yCor := <span style="color: #000000;">{</span><span style="color: #000000;">}</span> <br /><span style="color: #B900B9;">// Pasamos coordenadas de cms a pixel </span><br />xCor := oPrn:<span style="color: #000000;">Cmtr2Pix</span><span style="color: #000000;">(</span>nArriba,nIzq<span style="color: #000000;">)</span> <br />yCor := oPrn:<span style="color: #000000;">Cmtr2Pix</span><span style="color: #000000;">(</span>nAbajo,nDerecha<span style="color: #000000;">)</span> <br />oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span>xCor<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>,xCor<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>,yCor<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>,yCor<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>,nAncho,nAlto,oPen, nColor <span style="color: #000000;">)</span> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:11brt42o]
Saludos,
Carlos Gallego |
oPrn:RoundBox() (SOLUCIONADO) | Carlos,
a ti te muestra bien la caja???? Porque a mi, usando Fwh12.04 no...
Me la muestra cuadrada, sin usar le PEN que le indico y sin usar el color de fondo... Hoy voy a hecharle una miradita a la clase... |
oPrn:RoundBox() (SOLUCIONADO) | Byron,
Me pinta bien, tanto con FWH 12.04 como 12.05
Debes tener en cuenta que las medidas deben entrar en pixeles, pues nAncho y nAlto, que son las que definen la cantidad de redondeo de las esquinas, están en pixeles. En el caso del ejemplo, están a 90:
CajaRound(nArriba, nIzq, nAbajo, nDerecha, oPrn, nAncho, nAlto, oPen, nColor )
CajaRound( 1.6 , 15.0 , 3.4, 20.0 ,oPrn,90,90,oPen1,nRGB(250,250,250))
nArriba, nIzq, nAbajo y nDerecha, están en Centímetros, por lo que se convierten a pixeles.
xCor := oPrn:Cmtr2Pix(nArriba,nIzq)
yCor := oPrn:Cmtr2Pix(nAbajo,nDerecha)
oPrn:RoundBox(xCor[2],xCor[1],yCor[2],yCor[1],nAncho,nAlto,oPen, nColor )
Saludos,
Carlos Gallego |
oPrn:RoundBox() (SOLUCIONADO) | Bayron,
Usando la clase TPrinter con Preview has logrado que éste te abra ampliado ?. Por default lo abre reducido y no se distinguen los informes, y esto les molesta a los clientes pues no quieren tener que estar dando click para aumentar resolución.
He probado cuanta opción se me ha ocurrido, metiéndole la mano a TPrinter.prg, RPreview.prg y TMetafil.prg pero no consigo que funcione. Siempre abre con la vista reducida.
Si pongo [b:a1jtu46d]::lZoom := .T.[/b:a1jtu46d] lo abre aumentado pero bantante borroso.
Has revisado algo al respecto ?
Durante años usé MPreview del amigo José Lanín, y funcionaba perfecto, hasta FWH 10.10, pero ha sido imposible pasarla a FWH 12.05, razón por la que toca usar la del 12.05.
Saludos,
Carlos Gallego |
oPrn:RoundBox() (SOLUCIONADO) | Gracias Carlos, pero mi problema no son las coordenadas... yo las calculo de acuerdo a la resolución de la impresora, el problema es que no me toma en cuenta ni el brush, ni redondea las esquinas, ni pinta el fondo...
y no tengo ni idea por que...
Ya le hecharé una miradita al rpreview.... |
oPrn:RoundBox() (SOLUCIONADO) | Carlos, acabo de revisar un poco de rPreview y tmetafil.prg, el problema se da porque:
Seleccionando desde el menú el metodo ::Zoom(), funciona correctamente, pero al accionarlo inclusive despues de ::BuildWindow() en el método ::New() , solo la resolucion horizontal es calculada, pero no la vertical...
Esto supongo sería algo muy fácil para FiveTech de corregir, porque ellos conocen muy bien la clase, para mi seria un poco complicado... |
oPrn:RoundBox() (SOLUCIONADO) | uPSSSS, me faltaba
[code=fw:1zg30xbw]<div class="fw" id="{CB}" style="font-family: monospace;">nAncho, nAlto,</div>[/code:1zg30xbw] |
oPrn:RoundBox() diferente a oPrn:say | Hola amigos, sigo molestando con esto.
Encuentro comportamientos diferentes en
roundbox y say
cTitulo[11] := "Ruben & Dario"
oPrn:RoundBox( 1, 7.8, 1.8 , 13, 0.1,0.1, fPen1,CLR_WHITE, {cTitulo[11], oFont5, CLR_BLACK} ,"CM" ) ==> No muestra el carácter & y no lo imprime
oPrn:Say( 3, 7.8 , cTitulo[11] , oFonts, 5, nil, nil, 1, "CM" ) ==> Muestra e imprime correctamente
Saludos y gracias
Ruben Fernandez |
oPrn:RoundBox() diferente a oPrn:say | Cual és tú versión de FWH? Debria funcionar bién! versiones antiguas, no funciona mismo.
Regards, saludos. |
oPrn:RoundBox() diferente a oPrn:say | Es 22.12 la actual.
Gracias
Enviado desde mi 21081111RG mediante Tapatalk |
oPrn:RoundBox() diferente a oPrn:say | Entendido. Muestre un ejemplo práctico, para que el personal de FiveTech compile y confirme el defecto en esta versión de Fivewin que utiliza.
Regards, saludos. |
oPrn:RoundBox() diferente a oPrn:say | Ejemplo, mismo que usó Mr. Rao. Le agregué el símbolo &.
Difiere lo que se ve en Preview con lo que muestra en PDF (apretando boton de acrobat en el preview
En el PDF no se ven los textos en vertical
[code=fw:cv9uipbi]<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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oPrn, oPen, oPen2, oFont, oFontV, oFontS, oFont14V, oBrush<br /> <span style="color: #00C800;">local</span> cSyntax := <span style="color: #ff0000;">"Synt&&ax& : &"</span> + CRLF + ;<br /> <span style="color: #ff0000;">"RoundBox( nTop, nLeft, nBottom, nRight, nRndW, nRndH, oPen, onBack, aText, cUnits )"</span><br /> <span style="color: #00C800;">local</span> cText := <span style="color: #ff0000;">"aText :"</span> + CRLF + <span style="color: #ff0000;">"{ cText, oFont, nClrText, [cAlign] }"</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush FILE <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh2212<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>ackgrnd<span style="color: #000000;">\b</span>rowback.bmp"</span><br /><br /> <span style="color: #00C800;">PRINT</span> oPrn PREVIEW<br /><br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen WIDTH <span style="color: #000000;">3</span> <span style="color: #0000ff;">COLOR</span> CLR_HRED <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen2 WIDTH <span style="color: #000000;">1</span> <span style="color: #0000ff;">COLOR</span> CLR_BLACK <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontS <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span> <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontV <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-20</span> BOLD NESCAPEMENT <span style="color: #000000;">900</span> <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont14V <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span> NESCAPEMENT <span style="color: #000000;">900</span> <span style="color: #0000ff;">OF</span> oPrn<br /><br /> <span style="color: #0000ff;">PAGE</span><br /><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">1.0</span>, <span style="color: #000000;">1.0</span>, <span style="color: #000000;">2.0</span>, <span style="color: #000000;">7.5</span>, <span style="color: #000000;">0.4</span>, <span style="color: #000000;">0.4</span>, oPen, CLR_YELLOW, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"HORI&&ZONTAL&"</span> + CRLF + <span style="color: #ff0000;">"otro & texto &&, prueba&&&"</span> , <span style="color: #000000;">{</span> oFont, oFontS <span style="color: #000000;">}</span>, CLR_HRED <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">2.2</span>, <span style="color: #000000;">1.0</span>, <span style="color: #000000;">4.2</span>, <span style="color: #000000;">2.0</span>, <span style="color: #000000;">0.2</span>, <span style="color: #000000;">0.2</span>, oPen, CLR_GRAY, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"VERTICAL&"</span> + CRLF + <span style="color: #ff0000;">"TEXT&&"</span>, oFontV, CLR_YELLOW <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">5.9</span>, <span style="color: #000000;">1.5</span>, <span style="color: #000000;">7.1</span>, <span style="color: #000000;">2.1</span>, <span style="color: #000000;">0.1</span>, <span style="color: #000000;">0.1</span>, oPen2, CLR_HGRAY, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Faturas"</span>, oFont14V, CLR_BLACK <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">7.1</span>, <span style="color: #000000;">1.5</span>, <span style="color: #000000;">8.3</span>, <span style="color: #000000;">2.1</span>, <span style="color: #000000;">0.1</span>, <span style="color: #000000;">0.1</span>, oPen2, CLR_HGRAY, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Cálculo&"</span> + CRLF + <span style="color: #ff0000;">"Impo&sto"</span>, oFont14V, CLR_BLACK <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">8.3</span>, <span style="color: #000000;">1.5</span>, <span style="color: #000000;">10.2</span>, <span style="color: #000000;">2.1</span>, <span style="color: #000000;">0.1</span>, <span style="color: #000000;">0.1</span>, oPen2, CLR_HGRAY, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Transportador"</span>, oFont14V, CLR_BLACK <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">2.2</span>, <span style="color: #000000;">3.0</span>, <span style="color: #000000;">4.2</span>, <span style="color: #000000;">7.5</span>, <span style="color: #000000;">0.3</span>, <span style="color: #000000;">0.3</span>, oPen, oBrush, ;<br /> <span style="color: #000000;">{</span> cSyntax, oFont, CLR_BLACK <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">4.4</span>, <span style="color: #000000;">3.0</span>, <span style="color: #000000;">5.9</span>, <span style="color: #000000;">7.5</span>, <span style="color: #000000;">0.3</span>, <span style="color: #000000;">0.3</span>, oPen, CLR_WHITE, ;<br /> <span style="color: #000000;">{</span> cText, oFont, CLR_BLACK <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ENDPAGE</span><br /> <span style="color: #0000ff;">ENDPRINT</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:cv9uipbi]
Gracias y saludos
Ruben Fernandez |
oPrn:RoundBox() diferente a oPrn:say | Dario, mira:
[code=fw:1z3f05jy]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// C:\FWH..\SAMPLES\DARIOF.PRG</span><br /><br /><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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oPrn, oPen, oPen2, oFont, oFontV, oFontS, oFont14V, oBrush<br /> <span style="color: #00C800;">local</span> cSyntax := <span style="color: #ff0000;">"Synt&&ax& : &"</span> + CRLF + ;<br /> <span style="color: #ff0000;">"RoundBox( nTop, nLeft, nBottom, nRight, nRndW, nRndH, oPen, onBack, aText, cUnits )"</span><br /> <span style="color: #00C800;">local</span> cText := <span style="color: #ff0000;">"aText :"</span> + CRLF + <span style="color: #ff0000;">"{ cText, oFont, nClrText, [cAlign] }"</span><br /><br /> <span style="color: #00C800;">LOCAL</span> ctitulo9<br /><br /> ctitulo9 := <span style="color: #ff0000;">"Gancedo && Asociados S.R.L."</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush FILE <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh1905<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>ackgrnd<span style="color: #000000;">\b</span>rowback.bmp"</span><br /><br /> <span style="color: #00C800;">PRINT</span> oPrn PREVIEW<br /> <span style="color: #B900B9;">// PRINT oPrn FILE "DARIOF.pdf"</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen WIDTH <span style="color: #000000;">3</span> <span style="color: #0000ff;">COLOR</span> CLR_HRED <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen2 WIDTH <span style="color: #000000;">1</span> <span style="color: #0000ff;">COLOR</span> CLR_BLACK <span style="color: #0000ff;">OF</span> oPrn<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontS <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span> <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">OF</span> oPrn<br /><br /> <span style="color: #B900B9;">// ASI, NO GENERA EL DARIOF.PDF EL ARCHIVO RETORNA VACIO.</span><br /> <span style="color: #B900B9;">/*<br /> DEFINE FONT oFontV NAME "ARIAL" SIZE 0,-20 BOLD NESCAPEMENT 900 OF oPrn<br /> DEFINE FONT oFont14V NAME "ARIAL" SIZE 0,-14 NESCAPEMENT 900 OF oPrn<br /> */</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontV <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-20</span> BOLD <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont14V <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span> NESCAPEMENT <span style="color: #000000;">900</span> <span style="color: #0000ff;">OF</span> oPrn<br /><br /> <span style="color: #0000ff;">PAGE</span><br /><br /> <span style="color: #B900B9;">// FUNCIONA</span><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">1.0</span>, <span style="color: #000000;">1.0</span>, <span style="color: #000000;">2.0</span>, <span style="color: #000000;">7.5</span>, <span style="color: #000000;">0.4</span>, <span style="color: #000000;">0.4</span>, oPen, CLR_YELLOW, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"HORI&&ZONTAL&"</span> + CRLF + <span style="color: #ff0000;">"otro & texto &&, prueba&&&"</span> , <span style="color: #000000;">{</span> oFont, oFontS <span style="color: #000000;">}</span>, CLR_HRED <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">/* // AQUI, genera error y no genera el PDF.<br /> oPrn:RoundBox( 2.2, 1.0, 4.2, 2.0, 0.2, 0.2, oPen, CLR_GRAY, ;<br /> { "VERTICAL&" + CRLF + "TEXT&&", oFontV, CLR_YELLOW }, "INCHES" )<br /> */</span><br /><br /> <span style="color: #B900B9;">// SIN EL NESCAPEMENT FUNCIONA BIEN.</span><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">2.2</span>, <span style="color: #000000;">1.0</span>, <span style="color: #000000;">4.2</span>, <span style="color: #000000;">2.0</span>, <span style="color: #000000;">0.2</span>, <span style="color: #000000;">0.2</span>, oPen, CLR_GRAY, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"VERTICAL&"</span> + CRLF + <span style="color: #ff0000;">"TEXT&&"</span>, oFontV, CLR_YELLOW <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">/* // AQUI, genera error y no genera el PDF.<br /> oPrn:RoundBox( 5.9, 1.5, 7.1, 2.1, 0.1, 0.1, oPen2, CLR_HGRAY, ;<br /> { "Faturas", oFont14V, CLR_BLACK }, "INCHES" )<br /> */</span><br /><br /> <span style="color: #B900B9;">/* // AQUI, genera error y no genera el PDF.<br /> oPrn:RoundBox( 7.1, 1.5, 8.3, 2.1, 0.1, 0.1, oPen2, CLR_HGRAY, ;<br /> { "Cálculo&" + CRLF + "Impo&sto", oFont14V, CLR_BLACK }, "INCHES" )<br /> */</span><br /><br /> <span style="color: #B900B9;">/* // AQUI, genera error y no genera el PDF.<br /> oPrn:RoundBox( 8.3, 1.5, 10.2, 2.1, 0.1, 0.1, oPen2, CLR_HGRAY, ;<br /> { "Transportador", oFont14V, CLR_BLACK }, "INCHES" )<br /> */</span><br /><br /> <span style="color: #B900B9;">// FUNCIONA</span><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">2.2</span>, <span style="color: #000000;">3.0</span>, <span style="color: #000000;">4.2</span>, <span style="color: #000000;">7.5</span>, <span style="color: #000000;">0.3</span>, <span style="color: #000000;">0.3</span>, oPen, oBrush, ;<br /> <span style="color: #000000;">{</span> cSyntax, oFont, CLR_BLACK <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// FUNCIONA</span><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">4.4</span>, <span style="color: #000000;">3.0</span>, <span style="color: #000000;">5.9</span>, <span style="color: #000000;">7.5</span>, <span style="color: #000000;">0.3</span>, <span style="color: #000000;">0.3</span>, oPen, CLR_WHITE, ;<br /> <span style="color: #000000;">{</span> cText, oFont, CLR_BLACK <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// FUNCIONA</span><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">5</span>, .<span style="color: #000000;">5</span>, .<span style="color: #000000;">5</span>, <span style="color: #000000;">{</span> CLR_HRED, <span style="color: #000000;">3</span> <span style="color: #000000;">}</span>, oBrush, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"FIRST"</span> + CRLF + <span style="color: #ff0000;">"SECOND"</span>, oFont, CLR_WHITE, <span style="color: #ff0000;">"B"</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// FUNCIONA</span><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">7.8</span>, <span style="color: #000000;">1.8</span> , <span style="color: #000000;">15.50</span>, <span style="color: #000000;">0.5</span>,<span style="color: #000000;">0.5</span>, oPen, <span style="color: #000000;">{</span> CLR_WHITE, <span style="color: #000000;">3</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> cTitulo9, oFont, CLR_BLACK <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"CM"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ENDPAGE</span><br /><br /> <span style="color: #0000ff;">ENDPRINT</span><br /><br /> oFontV:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oFontS:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oFont14V:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrush:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// fin / end</span><br /> </div>[/code:1z3f05jy]
Regards, saludos. |
oPrn:RoundBox() diferente a oPrn:say | Disculpa las molestias.
No funciona con letra VERTICAL
No funciona cuando son 1 o 3 o 5 signos de & y si funciona con oPrn:say
Este es tu ejemplo y verás que no funciona del todo bien.
Si pones 2 &, imprime 1 y si ponere 3 & tambien imprime 1, si pones 4 imprime 2.
Los & impares no los muestra bien.
[b:qf76wewv]PERO[/b:qf76wewv], pienso que hay un error porque
oPrn:Say( 1, 15.5, cTitulo9 , oFont, 5, nil, nil, 1, "CM" )
[code=fw:qf76wewv]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// C:\FWH..\SAMPLES\DARIOF.PRG</span><br /><br /><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;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oPrn, oPen, oPen2, oFont, oFontV, oFontS, oFont14V, oBrush<br /> <span style="color: #00C800;">local</span> cSyntax := <span style="color: #ff0000;">"Synt&&ax& : &"</span> + CRLF + ;<br /> <span style="color: #ff0000;">"RoundBox( nTop, nLeft, nBottom, nRight, nRndW, nRndH, oPen, onBack, aText, cUnits )"</span><br /> <span style="color: #00C800;">local</span> cText := <span style="color: #ff0000;">"aText :"</span> + CRLF + <span style="color: #ff0000;">"{ cText, oFont, nClrText, [cAlign] }"</span><br /><br /> <span style="color: #00C800;">LOCAL</span> ctitulo9<br /><br />cTitulo7 := <span style="color: #ff0000;">" Gancedo & Asociados S.R.L."</span> <span style="color: #B900B9;">// FUNCIONA MUESTRA 1 &</span><br />cTitulo8 := <span style="color: #ff0000;">" Gancedo && Asociados S.R.L."</span> <span style="color: #B900B9;">// FUNCIONA MUESTRA 2 &</span><br />ctitulo9 := <span style="color: #ff0000;">"Gancedo && Asociados S.R.L."</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush FILE <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh1905<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>ackgrnd<span style="color: #000000;">\b</span>rowback.bmp"</span><br /><br /> <span style="color: #00C800;">PRINT</span> oPrn PREVIEW<br /> <span style="color: #B900B9;">// PRINT oPrn FILE "DARIOF.pdf"</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen WIDTH <span style="color: #000000;">3</span> <span style="color: #0000ff;">COLOR</span> CLR_HRED <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen2 WIDTH <span style="color: #000000;">1</span> <span style="color: #0000ff;">COLOR</span> CLR_BLACK <span style="color: #0000ff;">OF</span> oPrn<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontS <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span> <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">OF</span> oPrn<br /><br /> <span style="color: #B900B9;">// ASI, NO GENERA EL DARIOF.PDF EL ARCHIVO RETORNA VACIO.</span><br /> <span style="color: #B900B9;">/*<br /> DEFINE FONT oFontV NAME "ARIAL" SIZE 0,-20 BOLD NESCAPEMENT 900 OF oPrn<br /> DEFINE FONT oFont14V NAME "ARIAL" SIZE 0,-14 NESCAPEMENT 900 OF oPrn<br /> */</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontV <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-20</span> BOLD <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont14V <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span> NESCAPEMENT <span style="color: #000000;">900</span> <span style="color: #0000ff;">OF</span> oPrn<br /><br /> <span style="color: #0000ff;">PAGE</span><br /><br /> <span style="color: #B900B9;">// NO FUNCIONA TIENE MAS SIGNOS DE & </span><br /> <span style="color: #B900B9;">// FUNCIONA</span><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">1.0</span>, <span style="color: #000000;">1.0</span>, <span style="color: #000000;">2.0</span>, <span style="color: #000000;">7.5</span>, <span style="color: #000000;">0.4</span>, <span style="color: #000000;">0.4</span>, oPen, CLR_YELLOW, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"HORI&&ZONTAL&"</span> + CRLF + <span style="color: #ff0000;">"otro & texto &&7, prueba&&&&&"</span> , <span style="color: #000000;">{</span> oFont, oFontS <span style="color: #000000;">}</span>, CLR_HRED <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">/* // AQUI, genera error y no genera el PDF.<br /> oPrn:RoundBox( 2.2, 1.0, 4.2, 2.0, 0.2, 0.2, oPen, CLR_GRAY, ;<br /> { "VERTICAL&" + CRLF + "TEXT&&", oFontV, CLR_YELLOW }, "INCHES" )<br /> */</span><br /><br /> <span style="color: #B900B9;">// NO FUNCIONA CUANDO TIENE UN SIGNO & </span><br /> <span style="color: #B900B9;">// SIN EL NESCAPEMENT FUNCIONA BIEN.</span><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">2.2</span>, <span style="color: #000000;">1.0</span>, <span style="color: #000000;">4.2</span>, <span style="color: #000000;">2.0</span>, <span style="color: #000000;">0.2</span>, <span style="color: #000000;">0.2</span>, oPen, CLR_GRAY, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"VERTICAL&"</span> + CRLF + <span style="color: #ff0000;">"TEXT&&"</span>, oFontV, CLR_YELLOW <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">/* // AQUI, genera error y no genera el PDF.<br /> oPrn:RoundBox( 5.9, 1.5, 7.1, 2.1, 0.1, 0.1, oPen2, CLR_HGRAY, ;<br /> { "Faturas", oFont14V, CLR_BLACK }, "INCHES" )<br /> */</span><br /><br /> <span style="color: #B900B9;">/* // AQUI, genera error y no genera el PDF.<br /> oPrn:RoundBox( 7.1, 1.5, 8.3, 2.1, 0.1, 0.1, oPen2, CLR_HGRAY, ;<br /> { "Cálculo&" + CRLF + "Impo&sto", oFont14V, CLR_BLACK }, "INCHES" )<br /> */</span><br /><br /> <span style="color: #B900B9;">/* // AQUI, genera error y no genera el PDF.<br /> oPrn:RoundBox( 8.3, 1.5, 10.2, 2.1, 0.1, 0.1, oPen2, CLR_HGRAY, ;<br /> { "Transportador", oFont14V, CLR_BLACK }, "INCHES" )<br /> */</span><br /><br /> <span style="color: #B900B9;">// NO FUNCIONA cSyntax tiene mas & </span><br /> <span style="color: #B900B9;">// FUNCIONA</span><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">2.2</span>, <span style="color: #000000;">3.0</span>, <span style="color: #000000;">4.2</span>, <span style="color: #000000;">7.5</span>, <span style="color: #000000;">0.3</span>, <span style="color: #000000;">0.3</span>, oPen, oBrush, ;<br /> <span style="color: #000000;">{</span> cSyntax, oFont, CLR_BLACK <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// FUNCIONA</span><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">4.4</span>, <span style="color: #000000;">3.0</span>, <span style="color: #000000;">5.9</span>, <span style="color: #000000;">7.5</span>, <span style="color: #000000;">0.3</span>, <span style="color: #000000;">0.3</span>, oPen, CLR_WHITE, ;<br /> <span style="color: #000000;">{</span> cText, oFont, CLR_BLACK <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// FUNCIONA</span><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">5</span>, .<span style="color: #000000;">5</span>, .<span style="color: #000000;">5</span>, <span style="color: #000000;">{</span> CLR_HRED, <span style="color: #000000;">3</span> <span style="color: #000000;">}</span>, oBrush, ;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"FIRST"</span> + CRLF + <span style="color: #ff0000;">"SECOND"</span>, oFont, CLR_BLACK, <span style="color: #ff0000;">"B"</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #ff0000;">"INCHES"</span> <span style="color: #000000;">)</span><br /><br /> <br /> <span style="color: #B900B9;">// SI Y NO, FUNCIONA PERO TIENE 2 SIGNOS && // FUNCIONA</span><br /> <span style="color: #B900B9;">// CUANDO TIENE UN SIGNO DE & NO FUNCIONA </span><br /> oPrn:<span style="color: #000000;">RoundBox</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">7.8</span>, <span style="color: #000000;">1.8</span> , <span style="color: #000000;">15.50</span>, <span style="color: #000000;">0.5</span>,<span style="color: #000000;">0.5</span>, oPen, <span style="color: #000000;">{</span> CLR_WHITE, <span style="color: #000000;">3</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> cTitulo9, oFont, CLR_BLACK <span style="color: #000000;">}</span>, <span style="color: #ff0000;">"CM"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//FUNCIONA CORRECTAMENTE Y SE VE EXACTAMENTE LO MISMO AL GENERAR EL PDF </span><br />oPrn:<span style="color: #0000ff;">Say</span><span style="color: #000000;">(</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">15.5</span>, cTitulo7 , oFont, <span style="color: #000000;">15</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"CM"</span> <span style="color: #000000;">)</span><br />oPrn:<span style="color: #0000ff;">Say</span><span style="color: #000000;">(</span> <span style="color: #000000;">21</span>, <span style="color: #000000;">15.5</span>, cTitulo8 , oFont, <span style="color: #000000;">15</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"CM"</span> <span style="color: #000000;">)</span><br /><br /><br /><br /> <span style="color: #0000ff;">ENDPAGE</span><br /><br /> <span style="color: #0000ff;">ENDPRINT</span><br /><br /> oFontV:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oFontS:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oFont14V:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrush:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// fin / end</span></div>[/code:qf76wewv] |
oPrn:SETSIZE() no me funciona | Amigos:
Necesito imprimir etiquetas con código de barras, el tamaño de la etiqueta es de 6.5 cms de ancho por 2.5 cms de alto.
Cómo puedo indicarle a la clase TPrinter este pequeño tamaño ????
He probado con oPrn:SetSize pero no funciona.
Saludos, Armando |
oPrn:SETSIZE() no me funciona | Hola Armando
Si utilizas Barlib, por ejemplo para Ean13 es así
@ nLIz, nCIz ean13 ccodigo width npix size nlongi of oPrn banner
y los códigos de barra yo los he generado de 1 cm x 1 cm.
mira éste programa que hice hace mucho tiempo y juega con las medidas:
<!-- m --><a class="postlink" href="http://hyperupload.com/download/029f9c3d56/BARRAS.ZIP.html">http://hyperupload.com/download/029f9c3 ... S.ZIP.html</a><!-- m -->
Saludos
Jose Luis |
oPrn:SETSIZE() no me funciona | José Luis:
Muy bonito programa, te agradezco el interes.
Efectivamente estoy usando la excelente LIB de Cayetano y el problema que tengo no radica en especificar el tamaño del código de barras sino el tamaño de la etiqueta para que TPRinter salte al inicio de la siguiente despues de imprimir una, por cierto la impresora donde se usará es una ZEBRA que utiliza etiquetas en rollo.
Saludos y nuevamente gracias por tu respuesta |
oPrn:SETSIZE() no me funciona | Armando
Como podrás comprobar en el programa, hay unos get para el tamaño de la etiqueta y otros para el tamaño de las barras.
Bien, pues el tamaño que pudes poner es en cm. y admite cualquier tamaño, puedes poner por ejemplo tamaño de la etiqueta Alto 6.5 cm, Ancho 1.5 cm, le pones en grueso de la barra 0.02, y el alto de la barra 1, y te hace las etiquetas que le digas, o que tengas en una BD con esas dimensiones, indicándole los desplazamientos tras cada etiqueta y los margenes superior e inferior.
Esto es para ccualquier impresora que utilize por ejemplo Din A4, ahora si me dices que es una zebra, pues ya me pierdo un poco, aunque buscando en el foro, encontré ésto
<!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=6508&start=0&postdays=0&postorder=asc&highlight=zebra">http://fivetechsoft.com/forums/viewtopi ... ight=zebra</a><!-- m -->
Ahí viene un código compatible con ELTRON/ZEBRA
A ver si te sirve
Saludos
Jose Luis |
oPrn:SETSIZE() no me funciona | José Luis:
Muchas gracias por el apoyo, voy entendiendo.
Solo un par de preguntas más, que clase usas para la impresión, TDosPrn, TPrinter, TReport ?, podrías mostrar tu código de impresión ?
Saludos |
oPrn:SETSIZE() no me funciona | Voy a buscar...
Como te dije es un programa muy antiguo, y hecho un poco para uso personal, por lo tanto sin florituras, y como funciona, pues no me preocupé de cambiar nada.
Saludos
Jose Luis |
oPrn:SETSIZE() no me funciona | Aqui está
[code:1rt6zoqg]*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
*+
*+ Function codigo()
*+
*+ Called from ( barras.prg ) 1 - function main()
*+
*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
*+
function codigo( tipo, lprime, cprime, nancho, nlargo, ncodigo, ncanti, nOpci1, nlongi, npix, lini, cini, nnufo, npre, nDespH, nDespV, lPvp, lRef, lDen, nDesPvp, nDesRef, nDesDen, lBanner, cRef, cDetalle,tipo128 )
// ************************************************************************************************************************************************
local oPrn
local ccodigo
local llprime
local ccprime
local pasada := 1
local texto
local textoc
local textor
local npvp
local echo := 1
local nufo := nnufo
local oFont
local oFont1
local Conta :=0
local nindice:=tempo->(Recno())
private nLIz
private nCIz
private nLIzpvp
private nCIzpvp
private nLIzRef
private nCIzRef
private nLIzDes
private nCIzDes
if nOpci1=1
tempo->( dbSetfILTER( {|| tempo->selec=.T.},'tempo->selec=.T.') )
tempo->(dbgotop())
endif
printer oPrn from user preview
oPrn:SetPage(9)
if nufo != nil
DEFINE FONT oFont NAME( nufo[ 14 ] ) ;
SIZE 0, ( nufo[ 1 ] ) of oPrn
DEFINE FONT oFont1 NAME( nufo[ 14 ] ) ;
SIZE 0, ( nufo[ 1 ] ) of oPrn
else
DEFINE FONT oFont NAME "Arial" SIZE 0, 8 OF oPrn
DEFINE FONT oFont1 NAME "Arial" SIZE 0, 10 OF oPrn
endif
if nOpci1=2
npvp := alltrim( transform( npre, "@E 9,999.99" ) )
if tipo = 6
ncodigo := 'A' + alltrim( ncodigo ) + 'T'
endif
endif
ccodigo:=alltrim(ncodigo)
do while .t.
page
if pasada = 1
llprime := lini
ccprime := cini
else
llprime := lprime
ccprime := cprime
endif
texto := llprime - .27
textor := llprime - .6
textoc := llprime + nlongi
do while llprime + nlargo <= 29.7
CmtToPixel(llprime+nDespV, ccprime+nDespH, oPrn )
CmtToPvp (texto+nDespV, ccprime+nDespH+nDespvp ,oPrn)
CmtToRef (texto+nlongi+ndesPV+.3, ccprime+nDespH+ndesRef, oPrn)
CmtToDes (texto+nlongi+ndesPV+.5, ccprime+nDespH+ndesDen, oPrn)
if nOpci1=1
ccodigo := alltrim(tempo->codigo)
ncanti := tempo->cant
npvp := alltrim( transform( tempo->Pvp , "@E 99,999.99" ) )
cRef := alltrim(tempo->referencia)
cDetalle:=tempo->articulo
if tipo = 6
ccodigo := 'A' + alltrim( ccodigo ) + 'T'
endif
endif
do case
case tipo = 1
if lBanner
@ nLIz, nCIz ean13 ccodigo width npix size nlongi of oPrn banner
else
@ nLIz, nCIz ean13 ccodigo width npix size nlongi of oPrn
endif
if lPvp
oPrn:Say( nLIzpvp, nCIzpvp,'PVP '+npvp+' '+ ' €.', ofont )
endif
// como el codigo es lo mismo que la referencia, he quitado la referencia
if lRef
oPrn:Say( nLIzref, nCIzref,cRef, ofont )
endif
if lDen
oPrn:Say( nLIzdes, nCIzdes,OemToAnsi(rtrim(cDetalle)), ofont )
endif
case tipo = 2
if lBanner
@ nLIz, nCIz ean8 ccodigo width npix size nlongi of oPrn BANNER
else
@ nLIz, nCIz ean8 ccodigo width npix size nlongi of oPrn
endif
if lPvp
oPrn:Say( nLIzpvp, nCIzpvp,'PVP '+npvp+' '+ ' €.', ofont )
endif
if lRef
oPrn:Say( nLIzref, nCIzref,cRef, ofont )
endif
if lDen
oPrn:Say( nLIzdes, nCIzdes,OemToAnsi(rtrim(cDetalle)), ofont )
endif
case tipo = 3
@ nLIz, nCIz code128 ccodigo width npix size nlongi of oPrn mode tipo128
if lPvp
oPrn:Say( nLIzpvp, nCIzpvp,'PVP '+npvp+' '+ ' €.', ofont )
endif
if lRef
oPrn:Say( nLIzref, nCIzref,cRef, ofont )
endif
if lDen
oPrn:Say( nLIzdes, nCIzdes,OemToAnsi(rtrim(cDetalle)), ofont )
endif
case tipo = 4
@ nLIz, nCIz code3_9 ccodigo width npix size nlongi of oPrn
if lPvp
oPrn:Say( nLIzpvp, nCIzpvp,'PVP '+npvp+' '+ ' €.', ofont )
endif
if lRef
oPrn:Say( nLIzref, nCIzref,cRef, ofont )
endif
if lDen
oPrn:Say( nLIzdes, nCIzdes,OemToAnsi(rtrim(cDetalle)), ofont )
endif
case tipo = 5
if lBanner
@ nLIz, nCIz upca ccodigo width npix size nlongi of oPrn banner
else
@ nLIz, nCIz upca ccodigo width npix size nlongi of oPrn
endif
if lPvp
oPrn:Say( nLIzpvp, nCIzpvp,'PVP '+npvp+' '+ ' €.', ofont )
endif
if lRef
oPrn:Say( nLIzref, nCIzref,cRef, ofont )
endif
if lDen
oPrn:Say( nLIzdes, nCIzdes,OemToAnsi(rtrim(cDetalle)), ofont )
endif
case tipo = 6
@ nLIz, nCIz codabar ccodigo width npix size nlongi of oPrn
if lPvp
oPrn:Say( nLIzpvp, nCIzpvp,'PVP '+npvp+' '+ ' €.', ofont )
endif
if lRef
oPrn:Say( nLIzref, nCIzref,cRef, ofont )
endif
if lDen
oPrn:Say( nLIzdes, nCIzdes,OemToAnsi(rtrim(cDetalle)), ofont )
endif
case tipo = 7
if lBanner
@ nLIz, nCIz sup5 ccodigo width npix size nlongi of oPrn banner
else
@ nLIz, nCIz sup5 ccodigo width npix size nlongi of oPrn
endif
if lPvp
oPrn:Say( nLIzpvp, nCIzpvp,'PVP '+npvp+' '+ ' €.', ofont )
endif
if lRef
oPrn:Say( nLIzref, nCIzref,cRef, ofont )
endif
if lDen
oPrn:Say( nLIzdes, nCIzdes,OemToAnsi(rtrim(cDetalle)), ofont )
endif
endcase
ccprime += nancho
if nOpci1 = 1
if echo = ncanti
tempo->( dbskip() )
if tempo->( eof() )
exit
endif
do while .t.
if tempo->Selec=.F. .or. tempo->cant <= 0
tempo->(dbskip())
if tempo->( eof() )
exit
endif
else
exit
endif
enddo
if tempo->( eof() )
exit
endif
echo := 0
endif
endif
if echo = ncanti
exit
endif
echo += 1
if ccprime + nancho > 21
llprime += nlargo
texto += nlargo
textoc += nlargo
ccprime := cprime
endif
if llprime + nlargo >= 29.7
pasada += 1
exit
endif
enddo
endpage
SysRefresh()
do case
case nOpci1=1
if tempo->(Eof())
* if echo = ncanti
exit
endif
case nOpci1=2
if echo = ncanti
exit
endif
endcase
enddo
endprint
oFont:end()
oFont1:end()
tempo->(Dbsetfilter())
tempo->(Dbgoto(nindice))
return nil
static function CmtToPixel( nLi, nCi, oPrn )
local aPixel
aPixel := oPrn:Cmtr2Pix( nLi, nCi )
memvar->nLIz := aPixel[ 1 ]
memvar->nCIz := aPixel[ 2 ]
return NIL
[/code:1rt6zoqg]
A ver si te sirve de algo
Saludos
Jose Luis |
oPrn:SETSIZE() no me funciona | José Luis:
Muchas gracias, por supuesto que sirve y de mucho.
Voy a hincarle el diente
Saludos |
oPrn:Say() with background color. | Hello all,
any way to do it without using oPrn:RoundBox() before the oPrn:Say() ?
Thanks,
Davide
FWH 9.05 - xH 1.2.1 - Bcc 5.5 |
oPrn:SayBitMap | Hi, I'm having a problem with the instruction:
oPrn:SayBitmap(x,y,cFile,nWidth,nHight,nScale)
The Bitmap I'm trying to print is a 250,70 pixels BMP. It displays it fine in the preview (oPrn:SayBitmap(1,1,cFile)) but in the printer is very small (about .5 x .5 cms.).
I calculate the horizontal and vertical resolution for 80 cols and 60 rows.
I had a routine in FW 1.9 that worked fine but now with FW 2.4 it is not working.
As a matter of fact it works fine with oReport:SayBitmap.
I haven't found any reference on how to use the nHight,nWidth and nScale parameters. Any suggestion ?
Advanced thanks for your attention.
Andres |
oPrn:SayBitMap | Hi
you can use new Image.prg within FreeImage to modify your Printer.prg.
Regards,
Richard |
oPrn:SayBitMap | After several tests I found out that the parameters on the oSayBitmap work this way:
I have an bmp image 250,70 pixels, if I print it with oPrn:SayBitmap(1,1,'Image.bmp') it will be barely visible (about 1 cm).
You should play with these numbers to adjust the size you want. A 500,140 would show a decent logo.
On the oReport:SayBitmap() instruction, it works entirely different. |
oPrn:SayBitMap | Hi Asito
Have you tried the output on different printers with the same nWidth
and nHeight ?
I found the output is varying from printer to printer.
Can anybody suggest me what is the common mechanism to get a
constant output on any windows printer with the same program.
- Ramesh Babu P |
oPrn:SayBitMap | Image sizes are in pixel but pixel sizes change from printer to printer. You have to calculate how many pixels are needed to cover a specific paper area:
oPrn:SayBitmap( 0, 0, "IMAGE.BMP", oPrn:nHorzRes() / 4, oPrn:nVertRes() / 8 )
EMG |
oPrn:SayBitmap | Hola buenas noches, como puedo hacer para ajustar la imagen al tamaño que quiero.
Cuando la muestro por pantalla con ADJUST lo hago pero para imprimir no encuentro la forma.
Saludos
Jorge. |
oPrn:SayBitmap | [url:3ci0tmri]http://forums.fivetechsupport.com/viewtopic.php?f=6&t=40577&sid=5b5fc44838cd2a65305d1ee8a3ff1c16[/url:3ci0tmri] |
oPrn:SayBitmap | Perfecto, muchas gracias.
Saludos
Jorge |
oPrn:SayBitmap with resource ? | I am using the Printer class. I want to put a symbol at the beginning of a line ( checkmark ). The symbol ( and its counterpart ) are compiled in my resources.
I use the following to load the resources in a bitmap ( it works great for other purposes ):
aIBmp := { LoadBitMap( GetResources( ) , "INOK" ), LoadBitMap( GetResources( ), "INNO" ) }
Now I want to print out that checkmark so I use:
oPrn:SayBitmap( nRow, 5 * nCsp, aIBmp[1] )
In theory this should work. ( I have no problem printing external resources ). It doesn't. Do I need to get the value some other way from my resource so I can use it here ?
Thanks. |
oPrn:SayBitmap with resource ? | Tim
Consider this code .. you will have to use FreeImage.dll
[code=fw:wuikj7rt]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">IMAGE</span> oImg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"DOG"</span><br /> oPrint:<span style="color: #000000;">SayImage</span><span style="color: #000000;">(</span> Line, <span style="color: #000000;">(</span>oPrint:<span style="color: #000000;">nHorzRes</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>*.<span style="color: #000000;">80</span><span style="color: #000000;">)</span>, oImg,<span style="color: #000000;">800</span>,<span style="color: #000000;">600</span> <span style="color: #000000;">)</span> <br /> </div>[/code:wuikj7rt]
Rick Lipkin |
oPrn:SayBitmap with resource ? | Tim,
[quote="TimStone":39tii5s5]I am using the Printer class. I want to put a symbol at the beginning of a line ( checkmark ). The symbol ( and its counterpart ) are compiled in my resources.
I use the following to load the resources in a bitmap ( it works great for other purposes ):
aIBmp := { LoadBitMap( GetResources( ) , "INOK" ), LoadBitMap( GetResources( ), "INNO" ) }
Now I want to print out that checkmark so I use:
oPrn:SayBitmap( nRow, 5 * nCsp, aIBmp[1] )
In theory this should work. ( I have no problem printing external resources ). It doesn't. Do I need to get the value some other way from my resource so I can use it here ?
Thanks.[/quote:39tii5s5]
It's most likely that the bitmap is too small for the printer. Try adding width and height parameters to SayBitmap() method.
EMG |
oPrn:SetCopies() bug ? | Hello guys,
I've just noticed that oPrn:SetCopies(nCopies) works ok if the printed document is longer than 1 page, otherwise I always obtain a single copy.
I tried with different printers and machines, with or without PREVIEW (If PREVIEW a 2+ pages document and print them all I obtain n copies, while if I print only 1 page on a multipage preview I obtain only a single printed page)
Any clues ?
TIA
Davide
FWH 7.09 |
oPrn:SetCopies() bug ? | I've just tested FWH27 (xH) and found it behaved the same.
I've also found this function in printdc.c, but cannot see why it should work only for multipage documents.
Any idea ?
Thanks,
Davide
[code:2b4g5bgh]#ifdef __HARBOUR__
CLIPPER PRNSETCOPIES( PARAMS ) // ( nCopies ) --> lSuccess
#else
CLIPPER PRNSETCOPI( PARAMS ) // ES( nCopies ) --> lSuccess
#endif
{
LPDEVMODE lpDevMode;
PrinterInit();
lpDevMode = (LPDEVMODE) GlobalLock( pd.hDevMode );
lpDevMode->dmCopies = _parni( 1 );
if( PCOUNT() == 2 ) // Compatibility with previous syntax!
lpDevMode->dmCopies = _parni( 2 );
GlobalUnlock( pd.hDevMode );
_retl( TRUE );
}
[/code:2b4g5bgh] |
oPrn:SetCopies() bug ? | Ok, I've found out another printer (Brother) which works correctly, so it seems the problem is in the driver of the "HP LaserJet 5/5M PS" and the "HP LaserJet 4100" (maybe they both use the same driver).
Does that happened to anyone else before ? |
oPrn:SetCopies(n) Problem | When I use oPrn:SetCopies(2) the printer prints
page 1
page 2
page 1
page 2
Is it possible to force the printer to print
page 1
page 1
page 2
page 2
Thanks in advance,
Birol Betoncu |
oPrn:SetCopies(n) Problem | I have modified the Tprinter class.
I have inserted the following lines after setcopies method in line 244 and solved my problem
[code=fw:enespjr4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">METHOD</span> SetCollate<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> ; <br /> <span style="color: #000000;">(</span> PrnSetCollate<span style="color: #000000;">(</span> lOnOff <span style="color: #000000;">)</span>,; <br /> ::<span style="color: #000000;">Rebuild</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <br /><br /><span style="color: #B900B9;">// in your program, call</span><br /><br />SetCollate<span style="color: #000000;">(</span>.T.<span style="color: #000000;">)</span> <span style="color: #B900B9;">// or SetCollate(.F.)</span><br /> </div>[/code:enespjr4]
Birol Betoncu |
oPrn:SetCopies(n) Problem | Birol,
Thanks for sharing your solution <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
oPrn:SetSize(nWidthnHeigt) | Mr. Antonio Linares:
Why oPrn:SetSize(nWidth,nHeight) it does not work?
I tried with oPrn:SETSIZE(650,250) but it does not change the size of the page
PRINTER oPrt Preview
oPrn:SetSize(650,250) // I need 6.5cms x 2.5cms
Best regards and many thanks
Armando |
oPrn:SetSize(nWidthnHeigt) | Armando,
Please do it this way:
PrnSetSize( 650, 250 )
PRINTER oPrt Preview
...
ENDPRINT |
oPrn:SetSize(nWidthnHeigt) | Mr. Antonio:
No way, this is my source code
PrnSetSize( 650, 250 )
PRINTER oPrt Preview
DEFINE FONT oFnt1 NAME "ARIAL" SIZE 0,-6 OF oPrt BOLD
DEFINE FONT oFnt2 NAME "ARIAL" SIZE 0,-8 OF oPrt BOLD
DEFINE FONT oFnt3 NAME "ARIAL" SIZE 0,-9 OF oPrt BOLD
oTxtFile = TTxtFile():New(cFile,0)
oTxtFile:GOTOP()
DO WHILE ! oTxtFile:lEOF()
cLinea := oTxtFile:ReadLine()
cCod := LEFT(cLinea,11)
cEst := SUBSTR(cLinea,013,10)
cSku := SUBSTR(cLinea,069,04)
cLin := SUBSTR(cLinea,073,02)
cSln := SUBSTR(cLinea,075,04)
cPre := SUBSTR(cLinea,113,07)
cTxt := SUBSTR(cLinea,123,12)
cSku := STRZERO(VAL(cSku),4)
cSku += "-" + STRZERO(VAL(cLin),4)
cSku += "-" + STRZERO(VAL(cSln),4)
cPre := "$" + ALLTRIM(TRANSFORM((VAL(cPre) / 100),"99,999.99"))
PAGE
nMrgSup := 00
nMrgIzq := 15
@ nMrgSup,nMrgIzq UPCA cCod OF oPrt BANNER SIZE .7
nMrgSup += 120
oPrt:SAY(nMrgSup,nMrgIzq+900,cPre,oFnt2)
nMrgSup += 70
@ nMrgSup,nMrgIzq + 750 UPCA cCod OF oPrt BANNER SIZE .5
nMrgSup += 60
oPrt:SAY(nMrgSup,nMrgIzq,cSku,oFnt1)
nMrgSup += 50
oPrt:SAY(nMrgSup,nMrgIzq,cEst,oFnt1)
nMrgSup += 15
oPrt:SAY(nMrgSup,nMrgIzq+300,cPre,oFnt2)
nMrgSup += 55
oPrt:SAY(nMrgSup,nMrgIzq,cTxt,oFnt1)
oPrt:SAY(nMrgSup,nMrgIzq+850,cTxt,oFnt1)
ENDPAGE
oTxtFile:Advance()
ENDDO
ENDPRINT
oTxtFile:END()
Regards |
oPrn:SetSize(nWidthnHeigt) | Armando,
Are you going to print labels ? If yes, then just calculate a new label position from your code |
oPrn:SetSize(nWidthnHeigt) | Mr. Antonio:
Yes, I have to print labels.
The labels are in roll, continuous form, then that is my problem.
The TPrinter class use letter size by default.
Could you help me ?
Best regards |
oPrn:SetSize(nWidthnHeigt) | Armando,
Have you looked at FWH\SAMPLES\LABELS? This may help.
James |
oPrn:SetSize(nWidthnHeigt) | James:
Thanks for your reply.
I have seen the examples but it seems that all are for printing labels in letter size pages and I have to print in a special size and the code oPrn:SETSIZE(nWidth,nHeigt) does not work.
Best regards |
oPrn:SetSize(nWidthnHeigt) | Armando,
I don't know if this will help, but here is a copy of an old message about label printing.
You might also try searching the forum for "label."
James
-------------------------------
6/30/2006 11:36 AM
I use the Dymo Turbo 330 and run it from within a program. Here is the code I use:
FUNCTION ShipLabel
// Declare variables
LOCAL oDbf, nRow := 0
PRINT oPrn NAME "Report Printing" TO "DYMO LabelWriter 330 Turbo" // FROM USER
// Define the fonts to be used
DEFINE FONT oFnorm NAME "Courier New" SIZE 0, - 12 OF oPrn
DEFINE FONT oFbold NAME "Courier New" SIZE 0, - 12 BOLD OF oPrn
nRsp := oPrn:nVertRes() / 20 // Number of rows
nCsp := oPrn:nHorzRes() / 40 // Number of columns
oPrn:SetLandscape( )
nRow := 2 * nRsp
PAGE
oPrn:Say( nRow, 10 * nCsp, "MasterLink Software", oFbold )
nRow += nRsp
oPrn:Say( nRow, 15 * nCsp, "PO Box 740", oFbold )
nRow += nRsp
oPrn:Say( nRow, 5 * nCsp, "Trabuco Canyon, CA 92678-0740", oFbold)
nRow += nRsp
oPrn:Say( nRow, 2 * nCsp, "_________________________________", oFnorm )
nRow += 2 * nRsp
oPrn:Say( nRow, 2 * nCsp, oCli:company, oFnorm )
nRow += nRsp
oPrn:Say( nRow, 2 * nCsp, oCli:street, oFnorm )
nRow += nRsp
oPrn:Say( nRow, 2 * nCsp, TRIM(oCli:city) + ", " + oCli:state + " " + oCli:zipcode, oFnorm )
ENDPAGE
ENDPRINT
oFnorm:end()
oFbold:end()
RETURN NIL
The same, I suspect, would work with the 400. I hope this helps.
Tim
_________________
Tim Stone
<!-- w --><a class="postlink" href="http://www.MasterLinkSoftware.com">www.MasterLinkSoftware.com</a><!-- w --> |
oPrn:SetSize(nWidthnHeigt) | Thanks James, I will
Regards |
oPrn:SetSize(nWidthnHeigt) | Mr. Antonio:
This is a little sample of my problem
[code=fw:2q7xa2ca]<div class="fw" id="{CB}" style="font-family: monospace;"><ol><li style="" class="li1"> </li><li style="" class="li2">#Include <span style="color: #ff0000;">"FiveWin.ch"</span></li><li style="" class="li1"><span style="color: #008000;">FUNCTION</span> AppLbl1a<span style="color: #000000;">(</span><span style="color: #000000;">)</span></li><li style="" class="li2"> <span style="color: #008000;">LOCAL</span> oPrt,oFont,nVez</li><li style="" class="li1"> </li><li style="" class="li2"> PrnSetSize<span style="color: #000000;">(</span> <span style="color: #000000;">650</span>, <span style="color: #000000;">250</span> <span style="color: #000000;">)</span></li><li style="" class="li1"> <span style="color: #0000ff;">PRINTER</span> oPrt PREVIEW</li><li style="" class="li2"> </li><li style="" class="li1"> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span> <span style="color: #0000ff;">OF</span> oPrt</li><li style="" class="li2"> </li><li style="" class="li1"> MsgInfo<span style="color: #000000;">(</span>oPrt:<span style="">nHorzSize</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span></li><li style="" class="li2"> MsgInfo<span style="color: #000000;">(</span>oPrt:<span style="">nVertSize</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span></li><li style="" class="li1"> </li><li style="" class="li2"> oPrt:<span style="">SetSize</span><span style="color: #000000;">(</span><span style="color: #000000;">550</span>,<span style="color: #000000;">150</span><span style="color: #000000;">)</span> <span style="color: #007f00;">// This no modify the size, why ?</span></li><li style="" class="li1"> </li><li style="" class="li2"> MsgInfo<span style="color: #000000;">(</span>oPrt:<span style="">nHorzSize</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span></li><li style="" class="li1"> MsgInfo<span style="color: #000000;">(</span>oPrt:<span style="">nVertSize</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span></li><li style="" class="li2"> </li><li style="" class="li1"> <span style="color: #008000;">FOR</span> nVez := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">10</span></li><li style="" class="li2"> PAGE</li><li style="" class="li1"> oPrt:<span style="">SAY</span><span style="color: #000000;">(</span><span style="color: #000000;">50</span>,<span style="color: #000000;">40</span>,<span style="color: #ff0000;">"Printing ..."</span> + <span style="color: #0000ff;">STR</span><span style="color: #000000;">(</span>nVez<span style="color: #000000;">)</span>,oFont<span style="color: #000000;">)</span></li><li style="" class="li2"> ENDPAGE</li><li style="" class="li1"> <span style="color: #008000;">NEXT</span></li><li style="" class="li2"> </li><li style="" class="li1"> <span style="color: #0000ff;">ENDPRINTER</span></li><li style="" class="li2"><span style="color: #008000;">RETURN</span><span style="color: #000000;">(</span>NIL<span style="color: #000000;">)</span></li><li style="" class="li1"> </li></ol></div>[/code:2q7xa2ca]
What is wrong ?, I hope you can help me pls.
Regards |
oPrn:SetSize(nWidthnHeigt) | > oPrt:SetSize(550,150) // This no modify the size, why ?
We don't know it. It should work |
oPrn:SetSize(nWidthnHeigt) | Mr. Antonio:
Did you test my sample , works it fine to you
Could you make an exe file from my sample and send it to me
Best regards and tnks. |
oPrn:Setup() en FWH 16.12 | He compilado el código que ya tenía escrito de la versión anterior de FWH con la nueva versión 16.12 y aparte de GetCurDir() que lo he tenido que modificar los path y con esto se ha resuelto, también me hace mal el oPrn:Setup() ya que me saca la ventana de selección de impresora, me deja seleccionar una diferente a la predeterminada pero no funciona dicha selección porque selecciones la que sea siempre imprime por la prederterminada.
Si alguien le ha pasado esto y conoce la solución le estaría muy agradecido por sus indicaciones.
Gracias |
oPrn:Setup() en FWH 16.12 | [url:obscs9u0]http://forums.fivetechsupport.com/viewtopic.php?f=6&t=32000[/url:obscs9u0] |
oPrn:Setup() en FWH 16.12 | [code=fw:ojyvgmit]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Printing in portrait and in landscape</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00D7D7;">#define</span> PAD_LEFT <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> PAD_RIGHT <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> PAD_CENTER <span style="color: #000000;">2</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oPrn, oFont, oPen<br /> <span style="color: #00C800;">Local</span> nLinI, nColI, nLinF, nColF<br /> <br /><br /> <span style="color: #B900B9;">//PRINT oPrn NAME "Impresión en Vertical.." PREVIEW</span><br /><br /> <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Impresión en Vertical.."</span> PREVIEW <span style="color: #0000ff;">MODAL</span><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;">"Arial"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-10</span> BOLD <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen WIDTH <span style="color: #000000;">2</span> <span style="color: #0000ff;">OF</span> oPrn<br /><br /> oPrn:<span style="color: #000000;">Setup</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> oPrn:<span style="color: #000000;">SetPage</span><span style="color: #000000;">(</span><span style="color: #000000;">9</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// A4</span><br /> oPrn:<span style="color: #000000;">SetPortrait</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//Vertical</span><br /><br /> <span style="color: #0000ff;">PAGE</span><br /> nLinI := <span style="color: #000000;">0.90</span><br /> nColI := <span style="color: #000000;">0.90</span><br /> nLinF := <span style="color: #000000;">28.6</span><br /> nColF := <span style="color: #000000;">20.0</span><br /> oPrn:<span style="color: #000000;">Cmtr2Pix</span><span style="color: #000000;">(</span>@nLinI, @nColI<span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmtr2Pix</span><span style="color: #000000;">(</span>@nLinF, @nColF<span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">Box</span><span style="color: #000000;">(</span>nLinI, nColI, nLinF, nColF, oPen <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmSay</span><span style="color: #000000;">(</span> <span style="color: #000000;">1.0</span>, <span style="color: #000000;">1.0</span>, <span style="color: #ff0000;">"Superior Izquierda"</span>, oFont,,CLR_BLACK,,PAD_LEFT <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmSay</span><span style="color: #000000;">(</span> <span style="color: #000000;">1.0</span>, <span style="color: #000000;">10.5</span>, <span style="color: #ff0000;">"Superior Centro"</span>, oFont,,CLR_BLACK,,PAD_CENTER <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmSay</span><span style="color: #000000;">(</span> <span style="color: #000000;">1.0</span>, <span style="color: #000000;">20.0</span>, <span style="color: #ff0000;">"Superior Derecha"</span>, oFont,,CLR_BLACK,,PAD_RIGHT <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmSay</span><span style="color: #000000;">(</span><span style="color: #000000;">28.0</span>, <span style="color: #000000;">1.0</span>, <span style="color: #ff0000;">"Inferior Izquierda"</span>, oFont,,CLR_BLACK,,PAD_LEFT <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmSay</span><span style="color: #000000;">(</span><span style="color: #000000;">28.0</span>, <span style="color: #000000;">10.5</span>, <span style="color: #ff0000;">"Inferior Centro"</span>, oFont,,CLR_BLACK,,PAD_CENTER <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmSay</span><span style="color: #000000;">(</span><span style="color: #000000;">28.0</span>, <span style="color: #000000;">20.0</span>, <span style="color: #ff0000;">"Inferior Derecha"</span>, oFont,,CLR_BLACK,,PAD_RIGHT <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDPAGE</span><br /> <span style="color: #0000ff;">ENDPRINT</span><br /> <br /><br /> <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Impresion Horizontal..."</span> PREVIEW<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-10</span> BOLD <span style="color: #0000ff;">OF</span> oPrn<br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen WIDTH <span style="color: #000000;">2</span> <span style="color: #0000ff;">OF</span> oPrn<br /> oPrn:<span style="color: #000000;">SetPage</span><span style="color: #000000;">(</span><span style="color: #000000;">9</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//a4</span><br /> oPrn:<span style="color: #000000;">SetLandscape</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// HORIZONTAL</span><br /> <span style="color: #0000ff;">PAGE</span><br /> nLinI := <span style="color: #000000;">0.90</span><br /> nColI := <span style="color: #000000;">0.90</span><br /> nLinF := <span style="color: #000000;">20.1</span><br /> nColF := <span style="color: #000000;">28.6</span><br /> oPrn:<span style="color: #000000;">Cmtr2Pix</span><span style="color: #000000;">(</span>@nLinI, @nColI<span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmtr2Pix</span><span style="color: #000000;">(</span>@nLinF, @nColF<span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">Box</span><span style="color: #000000;">(</span>nLinI, nColI, nLinF, nColF, oPen <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmSay</span><span style="color: #000000;">(</span> <span style="color: #000000;">1.0</span>, <span style="color: #000000;">1.0</span>, <span style="color: #ff0000;">"Superior Izquierda"</span>, oFont,,CLR_BLACK,,PAD_LEFT <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmSay</span><span style="color: #000000;">(</span> <span style="color: #000000;">1.0</span>, <span style="color: #000000;">14.8</span>, <span style="color: #ff0000;">"Superior Centro"</span>, oFont,,CLR_BLACK,,PAD_CENTER <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmSay</span><span style="color: #000000;">(</span> <span style="color: #000000;">1.0</span>, <span style="color: #000000;">28.0</span>, <span style="color: #ff0000;">"Superior Derecha"</span>, oFont,,CLR_BLACK,,PAD_RIGHT <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmSay</span><span style="color: #000000;">(</span><span style="color: #000000;">19.5</span>, <span style="color: #000000;">1.0</span>, <span style="color: #ff0000;">"Inferior Izquierda"</span>, oFont,,CLR_BLACK,,PAD_LEFT <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmSay</span><span style="color: #000000;">(</span><span style="color: #000000;">19.5</span>, <span style="color: #000000;">14.8</span>, <span style="color: #ff0000;">"Inferior Centro"</span>, oFont,,CLR_BLACK,,PAD_CENTER <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">cmSay</span><span style="color: #000000;">(</span><span style="color: #000000;">19.5</span>, <span style="color: #000000;">28.0</span>, <span style="color: #ff0000;">"Inferior Derecha"</span>, oFont,,CLR_BLACK,,PAD_RIGHT <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDPAGE</span><br /> <span style="color: #0000ff;">ENDPRINT</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:ojyvgmit]
|
oPrn:Setup() en FWH 16.12 | Muchas gracias por tu respuesta karinha. No tengo ningún problema para cambiar la orientación, horizontal o vertical.
El problema que tengo es que si compilo con la version de FWH 11.07 cuando se ejecuta oPrn:Setup() me presenta Windows la ventana de Seleccionar Impresora con las impresoras instaladas en el PC, selecciono una que no es la predeterminada y me imprime por la que yo selecciono.
Sin embargo compilo el mismo código con FWH versión 16.12 cuando se ejecuta oPrn:Setup() me presenta Windows la ventana de Seleccionar Impresora con las impresoras instaladas en el PC, selecciono una que no es la predeterminada y me imprime por la predeterminada y no por la que yo he seleccionado.
Gracias. |
oPrn:Setup() en FWH 16.12 | Creo, sea esto:
[code=fw:ewanroy8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> DefaultPrinter<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><br /> <span style="color: #00C800;">LOCAL</span> nPrn, nRet<br /><br /> <span style="color: #B900B9;">// Abre a tela para a seleção da impressora</span><br /> <span style="color: #B900B9;">/*<br /> GetPrintDC( GetActiveWindow() )<br /><br /> // Coloca a impressora selecionada como Default do Windows<br /> SetDefaultPrinter( PRNGETNAME() )<br /> */</span><br /><br /> nRet := PrinterSetUp<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> nPrn := PrnGetName<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> nRet # <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// NADA A FAZER MUDA O DEFULT DA IMPRESSORA EM TEMPO REAL.</span><br /> SetDefaultPrinter<span style="color: #000000;">(</span> PRNGETNAME<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// MUDA O DEFAULT DA IMPRESSORA</span><br /><br /> <span style="color: #B900B9;">// Mensageria</span><br /><br /> <span style="color: #00C800;">ELSE</span><br /><br /> <span style="color: #B900B9;">// mensageria</span><br /><br /> <span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> .F. <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:ewanroy8]
nueva function de PRINTER.PRG de FWHX16.12
[code=fw:ewanroy8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> SetPrintDefault<span style="color: #000000;">(</span> cModel <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cDriver := StrToken<span style="color: #000000;">(</span> GetProfString<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Devices"</span>, cModel, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">1</span>, <span style="color: #ff0000;">","</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cPort := StrToken<span style="color: #000000;">(</span> GetProfString<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Devices"</span>, cModel, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">","</span> <span style="color: #000000;">)</span><br /><br /> WriteProfString<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Windows"</span>, <span style="color: #ff0000;">"Device"</span>, cModel + <span style="color: #ff0000;">","</span> + cDriver + <span style="color: #ff0000;">","</span> + cPort <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:ewanroy8]
Saludos. |
oPrn:cmSay() | Amigos:
Tengo 2 variables= Space(30)
xTit1 :=space(30)
xTit2 :=Space(30)
Al ingresar al programa tomas de una BD
xTit1 := TITULO->TITULO1 // los campos tiene el mismo valor 30 Chr.
xTit2 := TITULO->TITULO2
oPrn:cmSay(cmt,7 , xtit1,OF1, , , , 2)
cmt +=0.5
oPrn:cmSay(cmt,7 , xtit2 ,OF1, , , , 2)
Se supone que el 2 hace que se centren estos 2 títulos, pero no.
Agradezco alguna ayuda.
Muchas gracias.
Ruben Fernamdez. |
oPrn:cmSay() | Ya lo resolví
PadC(rtrim(ltrim(xTit1)),30," ")
Saludos
Ruben Fernandez. |
oRS:QueryResult() AND Fw_arrayToDbf | I'm using oRS:QueryResult() to load data in an array, that after I want to save in a DBF file. Something like this:
aValues := oBD:QueryResult( "SELECT * from clients" )
aux->( FW_ArrayToDBF( aValues ) )
If there is only one record in the table clients, this code does not work. |
oRS:QueryResult() AND Fw_arrayToDbf | [code=fw:lah7dwry]<div class="fw" id="{CB}" style="font-family: monospace;">aValues := oBD:<span style="color: #000000;">Execute</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"SELECT * from clients"</span> <span style="color: #000000;">)</span> <br />aux-><span style="color: #000000;">(</span> FW_ArrayToDBF<span style="color: #000000;">(</span> aValues <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <br /> </div>[/code:lah7dwry]
Use QueryResult for results containing one or two items
like:
SELECT SUM(AMT) FROM table WHERE..
SELECT AVG(AGE),SUM(SALARY) FROM tabe ..
etc
For reading several rows, use Execute() |
oRS:QueryResult() AND Fw_arrayToDbf | Thank you <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) --> |
oReport | To all,
since I use the most current version of FW I get randomly white pages in oReport.
As a workaround I shorted the page height in the new method.
Does someone else notice this behavior.
Best regards,
otto
new - method
::nHeight := ::oDevice:nVertRes() - 60 //OTTO |
oReport meter/ progressbar | Otto,
It looks like the delay is because you are using a filter. Try it without the filter and see how fast it is (just for a test). If that solves the speed issue, then you could build a modified index and use scopes.
James |
oReport meter/ progressbar | Is it possible to have a progressbar or a meter into oReport class.
Thanks in advance
Otto |
oReport meter/ progressbar | Hi Otto,
there is a dialog with message of page creation, you can use this dialog to put a progressbar, but the problem is to know how many pages has the report
to set the progressbar, you need to calculate this previus to send the report maybe an estimate or generate the report without preview and generate again to obtain the total pages, this is the same problem if you need to put page number like "pagen of totalpage" in this case I write this information at the end of report directly to the EMF files.
regards
Marcelo |
oReport meter/ progressbar | You can't know the total pages that will be printed but you know the total lines to be printed.
You can implement progress bar on the basis of number of lines printed in comparison with the total lines to be printed. The point is how do we get a callback to our program whenever a line is printed.
We supply a bSkip block the Report class. For DBF, report class has a default bSkip block. But we can supply our own bSkip block. It is in this bSkip block you provide, you can capture the record number being printed and use it in your progress bar.
But I do not find any need for progress bar for reports because the preview generation shows the user some kind of progress and that is adequate in most circumstances. |
oReport meter/ progressbar | Hello,
Maybe I make an error defining the report- but till the first msgwait from oReport appears 23 sec. pass.
Till now I always loaded the records I wanted to print into a temp dbf and then started the oReport printing the temp-dbf.
There a meter is easy to implement. In this case the msgwait appears quick.
But I thought I could do it without this extra code.
This is how I use oReport.
Best regards,
Otto
[code=fw:341qkapf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">function</span> rg_kontroll_druck<span style="color: #000000;">(</span>oStam<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oReport,oFont1, oFont2, oFont3, oPen1, oline,cTITLE:=<span style="color: #ff0000;">"Rechnungs-Zusammenstellung vom"</span><br /> <span style="color: #00C800;">local</span> anfang := date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">-1</span><br /> <span style="color: #00C800;">local</span> ende := date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">-1</span><br /> <span style="color: #00C800;">local</span> oDlg<br /> <span style="color: #00C800;">local</span> ok := .f.<br />*----------------------------------------------------------<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Vonbis"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Rechnungszusammenstellung"</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> anfang <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">picture</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"@D"</span><span style="color: #000000;">)</span> SPINNER<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> ende <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">picture</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"@D"</span><span style="color: #000000;">)</span> SPINNER<br /> <span style="color: #0000ff;">REDEFINE</span> BUTTONBMP <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">END</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> CANCEL ;<br /> BITMAP <span style="color: #ff0000;">".<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\D</span>elete.bmp"</span> TEXTRIGHT<br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">1</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>OK:=.T.,oDlg:<span style="color: #000000;">END</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /> <span style="color: #00C800;">IF</span> OK = .T.<br /><br /> <span style="color: #0000ff;">DEFINE</span> PEN oPen1 WIDTH <span style="color: #000000;">0.5</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-9</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont2 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-8</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont3 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span> BOLD<br /><br /> <span style="color: #0000ff;">select</span> umsatz<br /> set order <span style="color: #0000ff;">to</span> tag u_renr<br /> Go Top<br /><br /> REPORT oReport <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">" "</span>,cTITLE+<span style="color: #ff0000;">" "</span>+ dtoc<span style="color: #000000;">(</span>anfang<span style="color: #000000;">)</span>+<span style="color: #ff0000;">" - "</span>+dtoc<span style="color: #000000;">(</span>ende<span style="color: #000000;">)</span>,<span style="color: #ff0000;">" "</span> <span style="color: #0000ff;">LEFT</span> ;<br /> <span style="color: #0000ff;">FONT</span> oFont1,;<br /> oFont2,;<br /> oFont3 ;<br /> PEN oPen1;<br /> HEADER Setup<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">LizenzNehmer</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #ff0000;">" "</span>, ALLTRIM<span style="color: #000000;">(</span><span style="color: #ff0000;">"Erstellt: "</span> + dtoc<span style="color: #000000;">(</span>date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>+ <span style="color: #ff0000;">" - "</span>+time<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RIGHT</span>;<br /> FOOTER <span style="color: #ff0000;">"Seite "</span> + Str<span style="color: #000000;">(</span>oReport:<span style="color: #000000;">nPage</span>,<span style="color: #000000;">3</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">RIGHT</span> PREVIEW<br /><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Artnum"</span> <span style="color: #00C800;">DATA</span> umsatz->artnum <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span> <span style="color: #0000ff;">FONT</span> <span style="color: #000000;">2</span><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Bezeichnung"</span> <span style="color: #00C800;">DATA</span> umsatz->bezeichnun <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">26</span><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"an"</span> <span style="color: #00C800;">DATA</span> umsatz->datum1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span> <span style="color: #0000ff;">FONT</span> <span style="color: #000000;">2</span><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"ab"</span> <span style="color: #00C800;">DATA</span> umsatz->datum2 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span> <span style="color: #0000ff;">FONT</span> <span style="color: #000000;">2</span><br /><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Menge"</span> <span style="color: #00C800;">DATA</span> umsatz->menge <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">5</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999,999,999.9"</span><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Preis"</span> <span style="color: #00C800;">DATA</span> umsatz->preis <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">6</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999,999,999.99"</span> <span style="color: #0000ff;">FONT</span> <span style="color: #000000;">2</span><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Wert"</span> <span style="color: #00C800;">DATA</span> umsatz->wert TOTAL <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999,999,999.99"</span><br /><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Anzhg"</span> <span style="color: #00C800;">DATA</span> iif<span style="color: #000000;">(</span>umsatz->Anzhg<><span style="color: #000000;">0</span>, umsatz->Anzhg,<span style="color: #ff0000;">""</span><span style="color: #000000;">)</span> TOTAL <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999,999,999.99"</span><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Barzhg"</span> <span style="color: #00C800;">DATA</span> iif<span style="color: #000000;">(</span>umsatz->Barzhg<><span style="color: #000000;">0</span>, umsatz->Barzhg,<span style="color: #ff0000;">""</span><span style="color: #000000;">)</span> TOTAL <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999,999,999.99"</span><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Karte"</span> <span style="color: #00C800;">DATA</span> iif<span style="color: #000000;">(</span>umsatz->Karte<><span style="color: #000000;">0</span>, umsatz->Karte,<span style="color: #ff0000;">""</span><span style="color: #000000;">)</span> TOTAL <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999,999,999.99"</span><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Scheck"</span> <span style="color: #00C800;">DATA</span> iif<span style="color: #000000;">(</span>umsatz->Scheck<><span style="color: #000000;">0</span>, umsatz->Scheck,<span style="color: #ff0000;">""</span><span style="color: #000000;">)</span> TOTAL <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999,999,999.99"</span><br /> COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Kredit"</span> <span style="color: #00C800;">DATA</span> iif<span style="color: #000000;">(</span>umsatz->Kredit<><span style="color: #000000;">0</span>, umsatz->Kredit,<span style="color: #ff0000;">""</span><span style="color: #000000;">)</span> TOTAL <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999,999,999.99"</span><br /><br /> GROUP <span style="color: #0000ff;">ON</span> umsatz->renr HEADER xPADR<span style="color: #000000;">(</span>ALLTRIM<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span>umsatz->renr<span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">85</span><span style="color: #000000;">)</span>+xPADr<span style="color: #000000;">(</span>ALLTRIM<span style="color: #000000;">(</span>umsatz->name<span style="color: #000000;">)</span>,<span style="color: #000000;">195</span><span style="color: #000000;">)</span>+dtoc<span style="color: #000000;">(</span>umsatz->datum<span style="color: #000000;">)</span> FOOTER <span style="color: #ff0000;">"Summe"</span> <span style="color: #0000ff;">FONT</span> <span style="color: #000000;">3</span><br /><br /> END REPORT<br /> <br /> oReport:<span style="color: #000000;">CellView</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oLine:= oReport:<span style="color: #000000;">oTitle</span><br /> oLine:<span style="color: #000000;">aFont</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">3</span><span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> REPORT oReport ;<br /> <span style="color: #00C800;">FOR</span> umsatz->datum >=anfang .AND. umsatz->datum <= ende ;<br /> <span style="color: #0000ff;">ON</span> STARTGROUP oReport:<span style="color: #000000;">NewLine</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oPen1:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oFont1:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oFont2:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oFont3:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #00C800;">endif</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br /> </div>[/code:341qkapf] |
oReport meter/ progressbar | I agree with Mr James
Also an out off topic suggestion
Instead of
[quote:1p4m7a6p]iif(umsatz->Anzhg<>0, umsatz->Anzhg,"") PICTURE "999,999,999.99"[/quote:1p4m7a6p]
it may be simpler to write
[code=fw:1p4m7a6p]<div class="fw" id="{CB}" style="font-family: monospace;">umsatz->Anzhg <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@Z 999,999,999.99"</span></div>[/code:1p4m7a6p] |
oReport meter/ progressbar | Hello James,
thank you for the suggestion. I changed the code and use now a temporary index instead of the filter.
[code=fw:36xltgg9]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">select</span> umsatz<br /> <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">on</span> umsatz->datum TAG TEMPDAT3 <span style="color: #0000ff;">TO</span> TEMP TEMPORARY <span style="color: #00C800;">FOR</span> <span style="color: #000000;">(</span>umsatz->datum >= <span style="color: #000000;">(</span>anfang<span style="color: #000000;">)</span> .AND. umsatz->datum <= <span style="color: #000000;">(</span>ende<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> </div>[/code:36xltgg9]Now the Report msgwait shows within 2 sec.
Helo Mr. Rao,
Thank you for the information. Good to know that. It makes the code much easier to read.
Best regards,
Otto |
oReport meter/ progressbar | Otto,
>I changed the code and use now a temporary index instead of the filter.
Still a temp index will cause a lag since it needs to read the whole DBF. Why not use scopes? You may need to build a new permanant index including the date field at the start of the index. Then set the scope to the beginning and ending date. This will be very fast and you don't need a temp index.
index on dtos( datum ) + renr
Then set the scopes.
umsatz->(ordScope(0, dtos(anfang) ) // set top scope
umsatz->(ordScope(1, dtos(ende) ) // set bottom scope
umsatz->(dbgotop())
James |
oReport meter/ progressbar | Otto,
After thinking about it, the scopes in my previous message aren't going to work since you need to group by renr. It is late here and I am not thinking clearly. I will get back to you in the morning.
James |
oReport meter/ progressbar | Hello James,
Thank you. I tried with your code and it seems that all works very well.
Now there is no speed problem anymore.
Best regards,
Otto
[code=fw:1zviy12q]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">on</span> dtos<span style="color: #000000;">(</span>field->datum<span style="color: #000000;">)</span>+str<span style="color: #000000;">(</span>field->renr<span style="color: #000000;">)</span> tag u_datrg <span style="color: #B900B9;">//12</span><br />... <br /><br /><br /><br /> <span style="color: #0000ff;">select</span> umsatz<br /> <span style="color: #B900B9;">//index on umsatz->datum TAG TEMPDAT3 TO TEMP TEMPORARY FOR (umsatz->datum >= (anfang) .AND. umsatz->datum <= (ende))</span><br /> <br /> set order <span style="color: #0000ff;">to</span> tag u_datrg<br />umsatz-><span style="color: #000000;">(</span>ordScope<span style="color: #000000;">(</span><span style="color: #000000;">0</span>, dtos<span style="color: #000000;">(</span>anfang<span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// set top scope</span><br />umsatz-><span style="color: #000000;">(</span>ordScope<span style="color: #000000;">(</span><span style="color: #000000;">1</span>, dtos<span style="color: #000000;">(</span>ende<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// set bottom scope</span><br />umsatz-><span style="color: #000000;">(</span>dbgotop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <br /> <br /> <br /><br /> </div>[/code:1zviy12q] |
oReport meter/ progressbar | Otto,
Glad to hear it. But, don't you need to group by the field "renr" also? If so, then it gets more complicated. I came up with an idea, but it will take some testing to figure out the details.
James |
oReport meter/ progressbar | Otto,
for this topic I am happy using ADSRDD, because you can mix SQL with traditional table navigation,
in your case a simple select <colums> from <table> where <condition> order by <order> is the solution
you can try
regards
Marcelo |
oReport meter/ progressbar | Hello james,
the report is grouped by the field - and displayed ok.
Best regards,
Otto
Hello Marcelo,
I will test ADS when I have more time.
Best regards,
Otto |
oReport meter/ progressbar | Otto,
I found a simple sample that I made some years ago...
copy this (sql.prg, sql.rc) into fw sample folder, uncomment the lines to link ace32.lib and rddads.lib in the buildx.bat file and compile it.
to probe select CDX file type, connect to the currect directory .\ when you press the CONETAR button, the square must be change to green, then
put select * from customer into Consulta SQL text area and press Ejecutar
I hope this can be a sample, you can join more than one dbf file from the current directory, this can be easily changed to work with data dictionay and client server too.
saludos
Marcelo
[code=fw:3cy0ee1b]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span> <br /><br />REQUEST ADS<br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> oDlg, consulta := SPACE<span style="color: #000000;">(</span><span style="color: #000000;">400</span><span style="color: #000000;">)</span>, oLbx, path := SPACE<span style="color: #000000;">(</span><span style="color: #000000;">80</span><span style="color: #000000;">)</span>,;<br /> connect, tipo := <span style="color: #ff0000;">"CDX"</span>, hconn<br /><br /> RddRegister<span style="color: #000000;">(</span><span style="color: #ff0000;">"ads"</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> RddSetDefault<span style="color: #000000;">(</span><span style="color: #ff0000;">"Ads"</span><span style="color: #000000;">)</span><br /> AdsSetServerType <span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// local</span><br /> AdsSetFileType<span style="color: #000000;">(</span><span style="color: #000000;">3</span><span style="color: #000000;">)</span><br /><br /> SET DELETED <span style="color: #0000ff;">ON</span><br /> adsRightsCheck<span style="color: #000000;">(</span> .F. <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"consulta"</span> <br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> tipo <span style="color: #0000ff;">ID</span> <span style="color: #000000;">108</span> <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"NTX"</span>,<span style="color: #ff0000;">"CDX"</span>,<span style="color: #ff0000;">"ADT"</span><span style="color: #000000;">}</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> AdsSetFileType<span style="color: #000000;">(</span> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> tipo == <span style="color: #ff0000;">"NTX"</span>, <span style="color: #000000;">1</span>, ;<br /> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> tipo == <span style="color: #ff0000;">"CDX"</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> path <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">103</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> AdsDisconnect<span style="color: #000000;">(</span> hconn <span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">IF</span> <span style="color: #000000;">(</span> AdsConnect60<span style="color: #000000;">(</span> path , <span style="color: #000000;">1</span>,<span style="color: #ff0000;">"ADSSYS"</span>,,@hconn<span style="color: #000000;">)</span>, ;<br /> connect:<span style="color: #000000;">setcolor</span><span style="color: #000000;">(</span>CLR_GREEN, CLR_GREEN<span style="color: #000000;">)</span>,;<br /> connect:<span style="color: #000000;">setcolor</span><span style="color: #000000;">(</span>CLR_HRED, CLR_HRED <span style="color: #000000;">)</span> ;<br /> <span style="color: #000000;">)</span>,; <br /> connect:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> connect <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" "</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_HRED, CLR_HRED<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> consulta <span style="color: #0000ff;">ID</span> <span style="color: #000000;">104</span> <span style="color: #0000ff;">OF</span> oDlg<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">106</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> resultado<span style="color: #000000;">(</span> consulta <span style="color: #000000;">)</span><br /> <br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">107</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br /> dbcloseall<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> AdsDisconnect<span style="color: #000000;">(</span> hconn <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">FUNCTION</span> resultado<span style="color: #000000;">(</span> consulta <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oLbx,e<br /><br /> <br /> ADSCreateSQLStatement<span style="color: #000000;">(</span><span style="color: #ff0000;">"SQLarea"</span>,<span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">IF</span> ADSExecuteSQLDirect<span style="color: #000000;">(</span> consulta <span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">TRY</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"resultado"</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">LISTBOX</span> oLbx FIELDS <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"SQLarea"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"RESULTADO : "</span> + ALLTRIM<span style="color: #000000;">(</span> STR <span style="color: #000000;">(</span> SQLarea -> <span style="color: #000000;">(</span> LASTREC<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">200</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_BLUE<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">103</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> oLbx:<span style="color: #000000;">report</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /> sqlarea -> <span style="color: #000000;">(</span> DBCLOSEAREA<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> CATCH e<br /> ? <span style="color: #ff0000;">"COMANDO EJECUTADO"</span><br /> END<br /> <span style="color: #00C800;">ELSE</span><br /> <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Error en la ejecución de la consulta"</span><span style="color: #000000;">)</span><br /> sqlarea -> <span style="color: #000000;">(</span> DBCLOSEAREA<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:3cy0ee1b]
[code=fw:3cy0ee1b]<div class="fw" id="{CB}" style="font-family: monospace;">CONSULTA <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">29</span>, <span style="color: #000000;">88</span>, <span style="color: #000000;">436</span>, <span style="color: #000000;">141</span><br /><span style="color: #0000ff;">STYLE</span> DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU<br />CAPTION <span style="color: #ff0000;">"ADS - SQL"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"MS Sans Serif"</span><br />LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL<br /><span style="color: #000000;">{</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">108</span>, <span style="color: #ff0000;">"COMBOBOX"</span>, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP, <span style="color: #000000;">40</span>, <span style="color: #000000;">11</span>, <span style="color: #000000;">49</span>, <span style="color: #000000;">43</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">102</span>, <span style="color: #ff0000;">"EDIT"</span>, ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, <span style="color: #000000;">136</span>, <span style="color: #000000;">11</span>, <span style="color: #000000;">219</span>, <span style="color: #000000;">12</span><br /> CONTROL <span style="color: #ff0000;">"conectar"</span>, <span style="color: #000000;">103</span>, <span style="color: #ff0000;">"BUTTON"</span>, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, <span style="color: #000000;">360</span>, <span style="color: #000000;">11</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">14</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">104</span>, <span style="color: #ff0000;">"EDIT"</span>, ES_LEFT | ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, <span style="color: #000000;">13</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">414</span>, <span style="color: #000000;">57</span><br /> CONTROL <span style="color: #ff0000;">"Ejecutar"</span>, <span style="color: #000000;">106</span>, <span style="color: #ff0000;">"BUTTON"</span>, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, <span style="color: #000000;">376</span>, <span style="color: #000000;">101</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">14</span><br /> CONTROL <span style="color: #ff0000;">"Salir"</span>, <span style="color: #000000;">107</span>, <span style="color: #ff0000;">"BUTTON"</span>, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, <span style="color: #000000;">376</span>, <span style="color: #000000;">124</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">14</span><br /> CONTROL <span style="color: #ff0000;">"Local Path"</span>, <span style="color: #000000;">-1</span>, <span style="color: #ff0000;">"STATIC"</span>, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, <span style="color: #000000;">94</span>, <span style="color: #000000;">13</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">8</span><br /> CONTROL <span style="color: #ff0000;">"Consulta SQL"</span>, <span style="color: #000000;">-1</span>, <span style="color: #ff0000;">"STATIC"</span>, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, <span style="color: #000000;">13</span>, <span style="color: #000000;">29</span>, <span style="color: #000000;">60</span>, <span style="color: #000000;">8</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">110</span>, <span style="color: #ff0000;">"STATIC"</span>, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, <span style="color: #000000;">414</span>, <span style="color: #000000;">11</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">12</span><br /> CONTROL <span style="color: #ff0000;">"Tipo"</span>, <span style="color: #000000;">-1</span>, <span style="color: #ff0000;">"STATIC"</span>, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, <span style="color: #000000;">13</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">22</span>, <span style="color: #000000;">8</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">-1</span>, <span style="color: #ff0000;">"BUTTON"</span>, BS_GROUPBOX | WS_CHILD | WS_VISIBLE, <span style="color: #000000;">5</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">428</span>, <span style="color: #000000;">120</span><br /><span style="color: #000000;">}</span><br /><br /><br />RESULTADO <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">8</span>, <span style="color: #000000;">27</span>, <span style="color: #000000;">400</span>, <span style="color: #000000;">188</span><br /><span style="color: #0000ff;">STYLE</span> DS_SYSMODAL | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME<br />CAPTION <span style="color: #ff0000;">"RESULTADO CONSULTA"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"MS Sans Serif"</span><br />LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL<br /><span style="color: #000000;">{</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">101</span>, <span style="color: #ff0000;">"TWBrowse"</span>, <span style="color: #000000;">0</span> | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, <span style="color: #000000;">5</span>, <span style="color: #000000;">7</span>, <span style="color: #000000;">390</span>, <span style="color: #000000;">159</span><br /> CONTROL <span style="color: #ff0000;">"Salir"</span>, <span style="color: #000000;">102</span>, <span style="color: #ff0000;">"BUTTON"</span>, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, <span style="color: #000000;">345</span>, <span style="color: #000000;">171</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">14</span><br /> CONTROL <span style="color: #ff0000;">"RESULTADO"</span>, <span style="color: #000000;">200</span>, <span style="color: #ff0000;">"STATIC"</span>, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, <span style="color: #000000;">6</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">93</span>, <span style="color: #000000;">8</span><br /> CONTROL <span style="color: #ff0000;">"Reporte"</span>, <span style="color: #000000;">103</span>, <span style="color: #ff0000;">"BUTTON"</span>, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, <span style="color: #000000;">294</span>, <span style="color: #000000;">171</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">14</span><br /><span style="color: #000000;">}</span><br /><br /> </div>[/code:3cy0ee1b] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.