public void FindNext() { if (_Viewer == null) { throw new ApplicationException(Strings.RdlViewerFind_ErrorA_PropertyMustSetPriorFindNext); } if (tbFind.Text.Length == 0) // must have something to find { return; } RdlViewerFinds findOptions = ckMatchCase.Checked ? RdlViewerFinds.MatchCase : RdlViewerFinds.None; bool begin = position == null; position = _Viewer.Find(tbFind.Text, position, findOptions); if (position == null) { if (!begin) // if we didn't start from beginning already; try from beginning { position = _Viewer.Find(tbFind.Text, position, findOptions); } lStatus.Text = position == null ? Strings.RdlViewerFind_FindNext_Phrase_not_found : Strings.RdlViewerFind_FindNext_Reached_end_of_report; _Viewer.HighlightPageItem = position; if (position != null) { _Viewer.ScrollToPageItem(position); } } else { lStatus.Text = ""; _Viewer.HighlightPageItem = position; _Viewer.ScrollToPageItem(position); } }
public void FindNext() { if (_Viewer == null) { throw new ApplicationException("Viewer property must be set prior to issuing FindNext."); } if (tbFind.Text.Length == 0) // must have something to find { return; } RdlViewerFinds findOptions = ckMatchCase.Checked ? RdlViewerFinds.MatchCase : RdlViewerFinds.None; bool begin = position == null; position = _Viewer.Find(tbFind.Text, position, findOptions); if (position == null) { if (!begin) // if we didn't start from beginning already; try from beginning { position = _Viewer.Find(tbFind.Text, position, findOptions); } lStatus.Text = position == null ? "Phrase not found" : "Reached end of report, continued from top"; _Viewer.HighlightPageItem = position; if (position != null) { _Viewer.ScrollToPageItem(position); } } else { lStatus.Text = ""; _Viewer.HighlightPageItem = position; _Viewer.ScrollToPageItem(position); } }