Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to let form know report was actually printed?

Status
Not open for further replies.

Judi201

Technical User
Jul 2, 2005
315
US
Hi!

As stated above, I need to update data if a report (invoice) is actually printed, not just previewed. I am using WEXIST to determine whether to print page # or not and wondering if that might be a possible way to know if it printed.

Would someone please suggest a good way for the form that sets up and prints the report to know that the user didn't abort the job?

I'm still not sure what I can do on the report other than print!!!

Many thanks for any suggestions.

Judi
 
I don't think that you can actually guarantee that a report has reached paper. Windows sends the report to the printer and the printer can say that a report has been printed when in fact it has been chewed up.

I think your best bet is to use the technique that Mike suggested a while back and generate a variable based on [TT]WEXIST("Printing")[/TT]

Geoff Franklin
 

Judi,

Write a little function that updates your "report has been printed" flag. Place this function in a field in the report summary band of your report. Set the Print When condition to WEXIST("Printing").

That should work, with the caveat Geoff mentioned: there's no guarantee that the report has actually hit the paper. That said, it's a pretty reliable technique, because if something goes wrong with the printer, Windows should be able to react to that, typically by sending the report again.

What we really need is a way to determine if anyone actually reads our reports.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Geoff said:
I think your best bet is to use the technique that Mike suggested a while back and generate a variable based on WEXIST("Printing")

Geoff, as I said above, this is what I was trying to figure a way to do.

Mike said:
What we really need is a way to determine if anyone actually reads our reports.

LOL. I know, but clients want what they want whether they use them or not!! However, what I am working on right now will be used I am sure -- invoices <g>

Thanks for explaining how I could use the report to save the status.
<<Set the [red]Print When condition[/red] to WEXIST("Printing").>>
This is what I could not think of. You and Geoff are life-savers. Thanks so much for all of your help.

I won't hold you responsible for what the wind blows out the window! [smile]

Judi
 
see also sys(2040).

You can put a textarea in the report saying something like
iif(sys(2040)="2",setReallyPrintedFlag(pkey),"")

and have the udf return "" so nothing appears on the page.

(not sure if this is in versions prior to VFP9)

hth

Nigel
 
ah!

i've just seen the other thread... you're on vfp6 so that's no good for you.

n
 
Just a thought.

If it's critical to know for sure that the report did hit paper you can always prompt the user and ask (that's what windows does when you print a test page.

Mike Reigler
Melange Computer Services, Inc
 

Nigel,

SYS(2040) came in with VFP 8.0.

Mike (Reigler),

One possible problem with that is that there might be a delay between the program finishing the report and the report actually appearing -- as the report works its way through the spooler and the printer's internal buffer. Also, the user might be in a different room or building than the printer.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hi All,

Mike Lewis said:
Write a little function that updates your "report has been printed" flag.
That sounds so simple but I haven't been back because I was still trying to get this to work.

What I have now is: method on the form that sets up and prints the report. Method sets the property on the form to printed = .T. when called from ON EXIT of the summary band of the report.
This works.

I will answer some questions asked here.
1) It will be sufficient for now to ask the user if it printed correctly and continue with update if so. The user is physically near the printer. I will continue to think and monitor suggestions for other solutions later.

2) I checked out FAQ184-2919 and FAQ551060 as well as reading the quoted section in the book (which I have). As I said before, I understand what I need - just couldn't pull it off. I memtion this for anyone coming along later with the same problem.

As many of you have seen before -- some of the 'OOP' issues just seem to fly right over my head.[smile]

If there is a better way to do this, I would love to know.

Many, many thanks for your input and apologies for not responding earlier.

Judi

I have another issue now but will start a new thread as I consider this one closed.
 
Judi - this is one of those cases where you'd really be much better served by upgrading since you're planning to upgrade anyway. I'm really not sure what's holding you back. With minor exceptions, everything you've done in VFP 6 will work in VFP 9.

Tamar
 
Tamar,

$$$. As I have mentioned in other threads, I am recently retired and just trying my hand at this after being away from programming for many years. I had purchased VFP 6.0 when it came out thinking I might have time to keep up but it was not to be.

When I retired, I was asked to rewrite some old programs in a very pleasant situation and decided to try. I love it; want to learn all I can; and this forum has been wonderful ! But how much more I will have opportunity to do, I don't know.

Is there an 'upgrade path' from 6 to 9? I haven't really checked pricing yet, just trying to complete this project first.

I appreciate your comments and will look into getting it. I read about the new features but feel that I still have so much to learn even with 6.0.

Judi
 
AFAIK you can purchase the update version of vfp9, if you have vfp5 or newer. And there is no restriction to uninstall the version you updated from, as there was with vfp8.

The thing is, even only the intellisense feature will teach you vfp faster. It does not only help you autocompleting command names (you might even hate that at first), but it shows you all properties and methods of objects. Even with COM objects like oWord = CreateObject("Word.Application").

Bye, Olaf.
 
Olaf & Tamar,

I just can't believe this!! Tamar, that you took the time to look this up for me. I had just googled and found the price at Amazon. That is a lot less than I had expected it to be.
So I guess I have no excuse for not placing the order now!

I guess I am just reluctant to move from where I have gained a small 'comfort zone' into the all new.

I do apprecaite you help.

Judi
 
I guess I am just reluctant to move from where I have gained a small 'comfort zone' into the all new.

Relax. When you open VFP9 you will be immediately at home. You'll see a couple more buttons on the toolbar but that's the only visible change. I'm still supporting some stuff in VFP 6 and it's a real nuisance having to go back and give up all the little improvements.

My favourites:

Intellisense helps me when I forget some of the obscure options - especially when automating Word and Excel.

Code References on the Tools menu lets me find every call to a function or every use of a field throughout the project.

Docked and tabbed windows keep the desktop clear (I know it's trivial but VFP 6 gets so cluttered.

FileToStr() and StrToFile() make it so easy to handle text files.

Try it - you'll love it.

Geoff Franklin
 
Geoff and All,

I know that this advice is as good as all of the other that I have received from this forum.

I found my CD to see what I had to have to upgrade and remembered that my FOX is on the Visual Studio CD. I bought this because my (at the time 12 year old) grandson was living with me and wanting to move past BASIC toward 'game programming'. He wanted the C and I planned to use the FOX.

He did; I didn't until now. I will look into upgrading and see what my options are from here.

When you see a thread started with "I'm UPGRADED", you will know I have made it and will need plenty of help.

Thanks for everything. You are all the BEST!

Judi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top