| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > ReportManager Class > ReportManager Methods >====== OpenReport (prepare report for execution) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[open a virtual to execute on event openwindow reportmanager .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[printreport print the report .htm|{{btn_next_n.gif|Next page}}]] | | || **OpenReport, PROC, PROTECTED, VIRTUAL** {{blk2blue.jpg|blk2blue.jpg}} The **OpenReport **method prepares the report to execute and returns a value indicating success or failure. This is a good place to add any filters or keys specified at runtime. Valid return values are: | | Level:Benign | report opened successfully | | | Level:Notify | no records found | | | Level:Fatal | failed, cause unknown | **Member of: [[reportmanager methods.htm|ReportManager]]** **Implementation:** The TakeWindowEvent method or the Open method calls the OpenReport method depending on the value of the DeferOpenReport property. The OpenReport method calls the Process.Reset method to reset the ProcessClass object, calls the Next method to get the first report record, then opens the REPORT structure. The OpenReport method resets the DeferOpenReport property to zero so that if deferred, the OpenReport only happens with the first timer event. **Return Data Type:     **BYTE **Example:** **ReportManager.Open  PROCEDURE** **  CODE** ** PARENT.Open** ** IF ~SELF.DeferOpenReport** **  SELF.OpenReport         !call OpenReport if not deferred** ** END** **MyReportManager.TakeWindowEvent PROCEDURE** **!procedure data** **  CODE** ** IF EVENT() = EVENT:Timer** **  IF SELF.DeferOpenReport** **   SELF.OpenReport        !if deferred, call OpenReport on timer** **  ELSE** ** !procedure code** **MyReportManager.OpenReport  PROCEDURE** **  CODE** ** SELF.Process.SetFilter(UserFilter)  !set dynamic filter** ** SELF.DeferOpenReport = 0** ** SELF.Process.Reset** ** IF ~SELF.Next()** **  IF ~SELF.Report&=NULL** **   OPEN(SELF.Report)** **   IF ~SELF.Preview &= NULL** **    SELF.Report{PROP:Preview} = SELF.PreviewQueue.Filename** **   END** **  END** ** END** **See Also:     **[[deferopenreport defer open .htm|DeferOpenReport]], [[next get next report record .htm|Next]], [[open a virtual to execute on event openwindow reportmanager .htm|Open]], [[takewindowevent a virtual to process non field events reportmanager .htm|TakeWindowEvent]], [[reset position to the first element .htm|Process.Reset]]