Find() 공개 메소드

Finds the first instance of the search string.
public Find ( string search ) : fyiReporting.RDL.PageItem
search string
리턴 fyiReporting.RDL.PageItem
예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }