Page 2 of 2

Re: print preview

Posted: Tue Nov 17, 2020 11:04 am
by edk
Modified version of Execute report with NOSAVEBUTTON support.

You copy the files from the attachment to your hmg.3.4.4 folder overwriting previous versions (make a backup of them).
Rebuild HMG - just run BuildLib32.bat

Use in your sources:
Function:

Code: Select all

ExecuteReport (<cReportName>, <lPrintPreview>, <lSelectPrinter>, [<cOutputFile>], [<lNoSaveButton>])
Command:

Code: Select all

EXECUTE REPORT <ReportName> [[PREVIEW] [NOSAVEBUTTON]] [SELECTPRINTER] [FILE <cFile>]
Note, if you used in HMG the i_print.ch file from the previous post, which permanently removes the option to save while print preview, you must restore its original version!

Re: print preview

Posted: Tue Nov 17, 2020 5:07 pm
by franco
Thanks EDK, for the very quick response.
Where would we be in HMG without such knowledgeable members like you.
Thanks again,
Franco

Re: print preview

Posted: Wed Mar 03, 2021 1:30 am
by franco
I finally got this working. Actually figured it out thanks to EDK and I found another post to reset drive ( can not locate post right now).
I found that if I use save to disk from terminal would loose location on return. To fix this, after return from print I used the following.
At start of main program,

Code: Select all

PUBLIC cMypath := hb_curdrive()+ ':\'+ rtrim(curdir())
In any of print prodedures.

Code: Select all

SELECT PRINTER DEFAULT TO lSUCCESS PREVIEW NOSAVEBUTTON
PRINT()
dirchange(cMypath)