print preview

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

franco
Posts: 878
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

print preview

Post by franco »

I have a new client and when using print preview she picks print to the disc (file) then program seems to loose it`s current file and index.
I would like to take the disc out of print preview... is this possible.
Thanks in advance,
Franco
All The Best,
Franco
Canada
ROBROS
Posts: 256
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Location: D 83071 Stephanskirchen

Re: print preview

Post by ROBROS »

Maybe using the controls nosavebutton, haven't tried it yet

Robert
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: print preview

Post by SALINETAS24 »

franco wrote: Sat Nov 14, 2020 5:25 pm I have a new client and when using print preview she picks print to the disc (file) then program seems to loose it`s current file and index.
I would like to take the disc out of print preview... is this possible.
Thanks in advance,
Franco

Hola Franco no entiendo muy bien lo que te pasa. Creo entender que cuando terminas la rutina del REPORT y regresas al control del programa los registros del fichero activo se te han perdido y no se muestran en pantalla (GRID,BROWSE....). :?:

Si es eso, te diré que a mi también me ocurrió y lo solucione así,

Code: Select all

     cAlias:=DBF()                  // Me guardo la DBF Activa           
     _ALREPORT()
     DBSELECTAREA(cAlias)     // Regreso el control
Ah, y el motivo era porque usaba un CLOSE, DBCLOSE..., (no recuerdo bien :oops: ), pero alguna instrucción de ese tipo que volvía loco al puntero.

Espero te sea de ayuda, saludo virtual
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
franco
Posts: 878
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: print preview

Post by franco »

Thanks guys,
Robert I will try, makes sense.
Sal.. I have a few files open with relations. This seems to me a problem with all reports. No one has ever used the disk before. Works ok if pick
down arrow and pick file instead of default printer or any printer.
I would like to go into print.ch and take out the disk,
Anymore thoughts.
All The Best,
Franco
Canada
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: print preview

Post by edk »

franco wrote: Sat Nov 14, 2020 5:25 pm I have a new client and when using print preview she picks print to the disc (file) then program seems to loose it`s current file and index.
I would like to take the disc out of print preview... is this possible.
Thanks in advance,
Franco
This is because when saving a printout, the current working folder is changed.
There are two solutions:
1. By changing the HMG sources: in the h_controlmisc.prg file in the _HMG_PRINTER_SavePages function find the line

Code: Select all

cFullName := PutFile ( acFilter, NIL, cFolder, .F., cFileName, @cExtFile, i )
and replace: .F. to .T. , then rebuild HMG and your project.

2.Without the required changes to the HMG sources: store the current working folder before start print and then restore the original path of the working folder right after end print

Code: Select all

cCWD := HB_CWD()
START PRINTDOC
(...)
END PRINTDOC
HB_CWD( cCWD )
franco
Posts: 878
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: print preview

Post by franco »

Thanks Edk,
I will give try
All The Best,
Franco
Canada
franco
Posts: 878
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: print preview

Post by franco »

SALINETAS24, I tried nosavebutton does not seem to work. execute report re nosavebutton preview select printer.
execute report re preview nosavebutton select printer.... execute report re preview select printer nosavebutton
Tied all of the above.
EDK , I tried changing the source and buildalllib32.bat and rebuild project. Does not seem to work.
Setting the cCWD may work but I need to add it to all my print procedures. Also in print preview it does not leave the preview after
disk save so when printing to printer there is still a problem.
I still think by removing the disk on the preview screen is what i need. or make it not work in a _h program with a msg.
All The Best,
Franco
Canada
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: print preview

Post by edk »

Franco, try to prepare a small example to illustrate your issue. It's possible that I misunderstood.
franco
Posts: 878
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: print preview

Post by franco »

When I use
execute report ?.. preview select printer
I get a pick menu with print preview < > << >> (go to page) (thumb nail) (hour glass) (printer) (disk) (return arrow)
I want to remove the disk from the context menu, customer can not print to file from here.
All The Best,
Franco
Canada
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: print preview

Post by edk »

If you want to permanently disable the save button in the print preview, replace the i_print.ch file from the attachment and rebuild the HMG.

If you want to extend the functionality of Execute report with the optional disabling of the save button, I will try to prepare something for tomorrow.
Attachments
i_print.zip
(6.29 KiB) Downloaded 114 times
Post Reply