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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unlocking a reportfile

Status
Not open for further replies.

coldan

Programmer
Oct 19, 2008
98
AU
In my app I have reports in various flavours - some condensed others full of details.

I copy the master report file to 'myreports.frx' etc before use to manipulate the header for paper size.

I delete the old 'myreports.frx' as I enter the routine.

This myreports.frx is the basis for my treatment prg of printing.

I wish to allow the user to toggle between the full and condensed reports via a checkbox an the report prep screen.

All of my code operates correctly - however when I wish to run the 'other' report type immediately after the first ( as a user might want to) I cannot delete the previously used myreports.frx to enable a new one to be copied across.

How can I 'unlock' this myreports.frx to allow it to be deleted?

Thanks

Coldan
 
Problem Solved!

I changed the code from a COPY FILE to the API Copyfile and it successfully overwrites the file.

Coldan
 
"I changed the code from a COPY FILE to the API Copyfile and it successfully overwrites the file."

If the problem you were encountering was due to the overwriting of an existing file, you could have accomplished the same thing by using the VFP command:
SET SAFETY OFF
which, as long as the file was not in use by another user, would allow the file to be overwritten without any error message.

cSetSafety = SET('Safety') && Save orig. SAFETY setting
SET SAFETY OFF && Set as needed
<-- do whatever -->
SET SAFETY &cSetSafety && Restore to orig. SAFETY setting.

Also I hope that you are putting this generic file: MyReports.frx into a directory which is local to the individual workstation(s). In that way each workstation would have their own MyReports.frx thereby eliminating the possibility that multiple users wanting to print at the same time would not create conflict over this single 'generic' report form.

Good Luck,
JRB-Bldr
 
Coldan,

I'm not sure what you mean by a "condensed" version of the report. If you mean one that shows the group summaries, headers and footers, etc. rather than the detail bands, are you aware that the REPORT FROM command has a SUMMARY clause that will do exactly that?. It could avoid the need for you to create different flavours of the report in the first place.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Mike,

This report is a list per item containing a large number of fields and outputs to screen from which a PDF can be printed if required - the condensed report shows only a few of the fields so many more 'items' are shown on a page.

Thanks

Coldan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top