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

Report Preview

Status
Not open for further replies.

and0b

MIS
Mar 27, 2007
51
US
Hi!
I need some help with report command. When I was runing it one time only, it wsa ok, it was in preview mode until I closed it, but I want to run it twise, for different range of records and it does not stop any more in preview mode. here is how I'm running it:

REPORT FORM rep.frx preview for employee.company='ABC'
REPORT FORM rep.frx preview for employee.company='XYZ'

How to force it to stop in preview mode at first line and run second line after closing preview of the first report?

Thanks,
Andrew
 
Try to check with:
Code:
if wexist('Report Preview') or wexist('Report Designer')
   ** The previous window is still open
else
  run your second report
endif

Another way would be to run Preview in your own form which you can control and run second form from its destroy.

 
Here is some sample (from Mike Cagnon) for my suggestion about using a form to run the preview in:
Code:
oRepForm = CREATEOBJECT("Form")
WITH oRepForm
 .Caption = "My report Title"
 .WindowState = 2   **This will maximize the form
 .Show()
ENDWITH
REPORT FORM myReport.frx PREVIEW WINDOW (oRepForm.Name)
oRepForm.Release()

So, you may create your own form and in this particular case even call other report preview from form's Destroy.
 
I'm trying it right now, but it shows error message: "Command contains unrecognized phrase/keyword" and line: "REPORT FORM myReport.frx PREVIEW WINDOW (oRepForm.Name)" is highlited.
 
Sorry, it is working now, but without "for employee.company='ABC'" clause
 
So, did you make it to work? I was just showing an idea, not the ready to go code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top