Example #1
0
        /// <summary>

        /// Set the document to print

        /// </summary>

        /// <history>

        /// [Curtis_Beard]	   02/02/2005	Created

        /// [Curtis_Beard]	   09/10/2005	CHG: create grepPrint object to generate document

        /// [Curtis_Beard]      11/02/2005	CHG: Use try/catch and set doc to error message in catch

        /// </history>

        private void SetDocument()

        {
            try

            {
                GrepPrint _printDoc = new GrepPrint(__listView, __grepTable);



                switch (lstPrintTypes.SelectedIndex)

                {
                case 0:

                    __document = _printDoc.PrintSelectedItems();

                    break;

                case 1:

                    __document = _printDoc.PrintSingleItem();

                    break;

                case 2:

                    __document = _printDoc.PrintAllHits();

                    break;

                case 3:

                    __document = _printDoc.PrintFileList();

                    break;

                default:

                    __document = string.Empty;

                    break;
                }
            }

            catch (Exception ex)

            {
                // display error to user in document if an error occurred trying to generate

                // the document for printing

                __document = string.Format(Language.GetGenericText("PrintErrorDocument"), ex.Message);
            }
        }
Example #2
0
        /// <summary>
        /// Set the document to print
        /// </summary>
        /// <history>
        /// [Curtis_Beard]	   02/02/2005	Created
        /// [Curtis_Beard]	   09/10/2005	CHG: create grepPrint object to generate document
        /// [Curtis_Beard]      11/02/2005	CHG: Use try/catch and set doc to error message in catch
        /// </history>
        private void SetDocument()
        {
            try
             {
            GrepPrint _printDoc = new GrepPrint(__listView, __grepTable);

            switch (lstPrintTypes.SelectedIndex)
            {
               case 0:
                  __document = _printDoc.PrintSelectedItems();
                  break;
               case 1:
                  __document = _printDoc.PrintSingleItem();
                  break;
               case 2:
                  __document = _printDoc.PrintAllHits();
                  break;
               case 3:
                  __document = _printDoc.PrintFileList();
                  break;
               default:
                  __document = string.Empty;
                  break;
            }
             }
             catch (Exception ex)
             {
            // display error to user in document if an error occurred trying to generate
            // the document for printing
            __document = string.Format(Language.GetGenericText("PrintErrorDocument"), ex.Message);
             }
        }