> >
> >
> > Thanks Pete for your reply. Barbara gave me the following suggestion and this is what my colleague expecting me to do.
> >
> > "What you want is called asynchronous processing. The way you do this is by loading the invoices to be printed into a table with a status that indicates they are pending. Then your second service periodcially checks this table to find items that are pending and processes the ones found."
> >
> > how do i go about doing that? Can you help me out with this one. I never worked with VFP before and I am really lost.
> >
> > Thanks again,
> > Newbie Database Developer
>
>
> Morning From Canada,
> I think what she is referring to is you prep your invoices
> in a seperate table... ie the header table and the details
> table so you can process and print the invoices.
> The on the invoice header table would be one logical field
> set to .F. as a default.
> You could then have a secondary process, or maybe even a timer
> event in your main application that may only printer 1-2 invoices
> at a time. Then wait 20-30 seconds and print 1-2 more. As each
> invoice is printed you flip the logical flag to .T. so you know
> the invoice has been printed.
> I think you can see what this will do.... the printing is
> staged with smaller pieces of the entire print job happening
> rather than the entire printing of all the invoices in one shot.
> Printing then all at once if there are several hundreds or
> thousands will bog down the workstation for sure.
> Does this explaination help...? And if I have misguided
> what you were referring to Barbara please accept my apologies.
> Pete "the IceMan", from the Great White North of Canada.
Thanks for all the replies so far. Your explanation helps.
If you look at the following code.....what it does is that issues the invoices first, changes the date and then prints them out.
*-- Change the status_id to issued
*-- start timing how long to issue an invoice
*!* MESSAGEBOX("Start Timing!")
*!* LOCAL timeTracker
*!* timeTracker = DATETIME()
glissuedbuttonflag = .t.
This.Parent.imgIssued.ZOrder(0)
*!* IF SEEK(thisform.oMasterObject.oObjectStore.invoice_no, "a_invoices", "INVOICE_NO")
SELECT ("a_invoices")
SET ORDER TO invoice_no IN a_invoices DESCENDING
LOCATE FOR ALLTRIM(invoice_no) == ALLTRIM(thisform.oMasterObject.oObjectStore.invoice_no)
SET ORDER TO invoice_no IN a_invoices ASCENDING
IF FOUND()
*****************
thisform.cntbmentrybuttons.cmdEdit.click
thisform.oMasterObject.oObjectStore.status_id = "002" &&- issued
thisform.cntbmentrybuttons.cmdSave.click
*****************
*!* SET REPROCESS TO 10 SECONDS
*!* IF FLOCK("a_invoices")
*!* replace a_invoices.status_id WITH "002"
&&- issued
*!* thisform.oMasterObject.oObjectStore.status_id = "002"
IF EMPTY(a_invoices.issuedate) OR ISNULL(a_invoices.issuedate)
replace a_invoices.issuedate WITH DATE()
thisform.oMasterObject.oObjectStore.issuedate = DATE()
ENDIF
thisform.cntbmprintbuttons.cmdPrint.click
thisform.cntinvoicingdata.orderPages.page1.cntshippinginfo.cboStatus.refresh()
thisform.cntinvoicingdata.orderpages.page1.cntshippinginfo.cntdate1.refresh()
thisform.cntinvoicingdata.label1.caption = "ISSUED"
*!* UNLOCK IN a_invoices
*!* ELSE
*!* WAIT WINDOW 'Unable to open Invoices Table; try again later!' NOWAIT
*!* ENDIF
ELSE
g_alert("Invoice is not found!")
RETURN .f.
ENDIF
this.Enabled = .f.
glissuedbuttonflag = .f.
thisform.Refreshform()
*-- determines how long it takes to issue an invoice
*!* timeTracker = DATETIME() - timeTracker
*!* timeTracker = "Time:" + STR(timeTracker) + " seconds."
*!* MESSAGEBOX(timeTracker)
I don't want invoices to get printed out here. All i want to do is save them. What are the changes in the code.. I guess i would need to take out the following line
thisform.cntbmprintbuttons.cmdPrint.click
because it starts printing, once the issue button is clicked and just save.....what needs to be added there.. ?
Thanks for the help :) & hope your doing good in the Town of Marathon
Newbie Database Developer