View Full Version : Printing reports from forms


Larry Ternowski
01-20-2005, 06:16 PM
I have been able to copy and paste and then edit the "Events" of the "Print this invoice" button from the alphasports database into my application and this is an exciting development/improvement to my application.

What I do not understand is how the alphasports database deals with the record when it is in an edit mode. I have noticed that when I change a quantity in the invoice on the alphasports invoice, it will update and print the change. When I do this in my application it does not print the change unless I do a page up/page down to get the record out of the edit mode.

Any help/insight will be appreciated.


Al Buchholz
01-20-2005, 07:25 PM

In Alphasports, the line items are in a browse.

When you make changes in the browse and leave the browse to press the print button on the form, the record is automactically saved.

In fact when you change rows within, the save is made also.

Try changing the payment type in Alphasports without a save. The invoice will still have the older payment type on it.

I usually put a save on the button that prints an invoice so that I know the latest changes have been committed.

Others may have more and varied suggestions

Jim Chapman
01-20-2005, 07:27 PM
Hello Larry,

You must save your edits before it will appear in the report. Alpha defaults to 'save changes', so when you move off the edited record with you page up/down keys, Alpha assumes that you want to save your changes and does. But if you simply push a button on the form to print the current record, another process goes and does your bidding. This new process looks at the records, and as you haven't save it yet, the reporting process sees the actual value in the table and prints/displays it. If you want to make sure any edits that are in process show up in the printing, you must issue some type of save command first. You can easily do this in Action Scripting. Or you can put the xbasic command:


before the print report command.

Good luck,

Larry Ternowski
01-21-2005, 06:52 AM
Thanks for the ideas. I did a little more poking around this morning and I found that in the editing of the "Events" for the button there was an "add new action" choice. Under the "form/browse" field there was a "refresh display" choice. I inserted this before the print action item and it is now updating automatically.

Your ideas got me pointed in the right direction and I was able to come up with a solution very easily.

The printing from the "Form page" was a wish item for a long time and when I got down to trying to do it, it took less than an hour. Sure will make my application a lot easier to use.

Again, thanks for the help.