Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Second copy as duplicate
Message
From
20/05/2009 11:54:37
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01400888
Message ID:
01400977
Views:
41
>>>i have set the Copies=2
>>>
>>>i want to print "Duplicate " on copy 2
>>>
>>>warm regards,
>>>mk.
>>
>>I am assuming you print the report from a cursor. In addition to commands you already have to prepare your cursor, do a SELECT ... UNION of all the data in your cursor, adding one field to indicate the copy number (#1 for first copy, #2 for second). Have a field with conditional printing, or a conditional expression that changes depending on the copy number.
>
>I don't think UNION would work, though you can have a field in the cursor to mark the copy and update this field in Report Footer on exit expression.
>
>This way you don't need to know if the report was printed or not - you just call a function to update this extra field.

Something like this:
* Several commands that select records for the main report,
* result is cursor Temp1

select *, "1" as NumCopy from Temp1;
  union select *, "2" as NumCopy from Temp1;
  into cursor Temp2
select ... from Temp2 order by NumCopy, ...;
  into cursor Temp2

report form ...
The cursor Temp2 has twice as many records as the original Temp1; field NumCopy indicates whether you processing copy #1, or copy #2.

The report should have a data grouping on field NumCopy, or including this field at any rate.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform