Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'flag' a record
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00666844
Message ID:
00667318
Views:
20
I'm not sure that I follow what you are asking, but I'm gonna make an attempt at answering your question. I think you are asking how to update the records as you print them.

Technically .. you could call a UDF or method in the On Exit expression of the Detail band and update the record with code in that UDF or method call. However, I don't recommend this because there's no way to know whether the user pressed the cancel button before FoxPro finished printing.

This is how I would suggest you do this:

#1 -- In a program .. prime some variables and run the report ...
*-- Prime
lPrinted = .f.
*-- Run the report
SELECT MyTable
REPORT FORM MyReport FOR NOT MyTable.printed TO PRINTER PROMPT 
*-- Update the flags
IF lPrinted
  REPLACE ALL printed WITH .t. FOR NOT MyTable.printed IN MyTable
ENDIF
#2 -- Define the report

- Create a Summary Band in the report
- In the "On Exit" expression of the Summary Band, place the following expression:
_VFP.SetVar('lPrinted', .t.)
What this does is ensure that the user let the report finish printing. The Summary Band is the last thing it processes so by setting the lprinted flag in the On Exit, you can ensure that the user let the report go.

This example assumes that nobody else is updating the table at the same time you are printing. If this is a possibility in your app .. then I would suggest copying the table to a cursor and printing from the cursor. Then you can loop thru the cursor to go back and update the original table.

I hope this helps!
Cathy

>how can i 'flag' a record to a field at the same record that have we print that record?
>
>example:
>name | printeds
>---------------
>ari | 'F'
>henry| 'F'
>
>if we already print record 1 and yet record 2, so the table change into:
>name | printeds
>---------------
>ari | 'T'
>henry| 'F'
>
>if we already print record 1, so we can't print record 1, just record 2,
>after we print record 2, the table change into:
>name | printeds
>---------------
>ari | 'T'
>henry| 'T'
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Previous
Reply
Map
View

Click here to load this message in the networking platform