print preview

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

edk
Posts: 998
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: print preview

Post 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!
Attachments
Execute report with no save button option.zip
(9.29 KiB) Downloaded 104 times
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: print preview

Post by franco »

Thanks EDK, for the very quick response.
Where would we be in HMG without such knowledgeable members like you.
Thanks again,
Franco
All The Best,
Franco
Canada
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: print preview

Post 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)
All The Best,
Franco
Canada
Post Reply