Preview-How to pass a parameter
Preview-How to pass a parameter
Preview
Could someone suggest an easy way to pass a parameter to preview?
In certain cases I need more buttons than the standard preview menu has.
How could I pass a parameter for example cCalledFrom to rpreview to know which function called the preview to adapt the menu.
If cCalledFrom = “Billing”
DEFINE BUTTON RESOURCE "Printer" OF oBar GROUP ;
MESSAGE TXT_PRINT_CURRENT_PAGE ;
ACTION f_name() ;
prompt "T e s t" TOOLTIP Strtran(TXT_PRINT,"&","")
endif
Thanks in advance
Otto
Could someone suggest an easy way to pass a parameter to preview?
In certain cases I need more buttons than the standard preview menu has.
How could I pass a parameter for example cCalledFrom to rpreview to know which function called the preview to adapt the menu.
If cCalledFrom = “Billing”
DEFINE BUTTON RESOURCE "Printer" OF oBar GROUP ;
MESSAGE TXT_PRINT_CURRENT_PAGE ;
ACTION f_name() ;
prompt "T e s t" TOOLTIP Strtran(TXT_PRINT,"&","")
endif
Thanks in advance
Otto
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
Re: Preview-How to pass a parameter
Otto
I write to a txt file username.txt and the preview checks to see if the file is there, it erases it at the end
Hth
Richard
I write to a txt file username.txt and the preview checks to see if the file is there, it erases it at the end
Hth
Richard
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
Otto
if i understood correctly your question, the data is needed to be used by the preview, so it has to be deleted after printing in order to load some other data if needed next time.
The file i use is unique per user, so the information is there. The name of the file is retreived from netname() + '.txt' . i use it to pass to the preview the customer's email from the customer file and then the preview email's at the correct address.
Another solution would be to chane the preview and add data to the classs , cargo or anything else.
This depends what you want to do at preview
Hth
Richard
if i understood correctly your question, the data is needed to be used by the preview, so it has to be deleted after printing in order to load some other data if needed next time.
The file i use is unique per user, so the information is there. The name of the file is retreived from netname() + '.txt' . i use it to pass to the preview the customer's email from the customer file and then the preview email's at the correct address.
Another solution would be to chane the preview and add data to the classs , cargo or anything else.
This depends what you want to do at preview
Hth
Richard
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Thank you for your answers.
Enrico, do you have some code how this could be done.
Do I have to start in printer.prg which calls rpreview?
Do you think this could work?
add xPreview to printer.prg
METHOD xPreview() INLINE If( ::lMeta .and. Len( ::aMeta ) > 0 .and. ::hDC != 0,;
xRPreview( Self ), ::End() )
and add xRPreview.prg with the changes.
Enrico, do you have some code how this could be done.
Do I have to start in printer.prg which calls rpreview?
Do you think this could work?
add xPreview to printer.prg
METHOD xPreview() INLINE If( ::lMeta .and. Len( ::aMeta ) > 0 .and. ::hDC != 0,;
xRPreview( Self ), ::End() )
and add xRPreview.prg with the changes.
Last edited by Otto on Tue Nov 13, 2007 11:00 am, edited 1 time in total.
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Yes, but the problem in creating a modified copy of rpreview.prg is that you have to apply to it any changes/fixes made later to the original file. I recommend inheritance instead.Otto wrote:Do you think this could work?
add xPreview to printer.prg
METHOD xPreview() INLINE If( ::lMeta .and. Len( ::aMeta ) > 0 .and. ::hDC != 0,;
xRPreview( Self ), ::End() )
and add xRPreview.prg with the changes.
EMG
Last edited by Enrico Maria Giordano on Tue Nov 13, 2007 12:49 pm, edited 1 time in total.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: