コード例 #1
0
        public byte[] SaveDocument(enFileFormat _enFileFormat)
        {
            byte[] btDocument = null;

            DocumentFormat df = new DocumentFormat();

            switch (_enFileFormat)
            {
            case enFileFormat.Csv:
                df = DocumentFormat.Csv;
                break;

            case enFileFormat.OpenXml:
                df = DocumentFormat.OpenXml;
                break;

            case enFileFormat.Text:
                df = DocumentFormat.Text;
                break;

            case enFileFormat.Xls:
                df = DocumentFormat.Xls;
                break;

            case enFileFormat.Xlsm:
                df = DocumentFormat.Xlsm;
                break;

            case enFileFormat.Xlsx:
                df = DocumentFormat.Xlsx;
                break;

            case enFileFormat.Xlt:
                df = DocumentFormat.Xlt;
                break;

            case enFileFormat.Xltm:
                df = DocumentFormat.Xltm;
                break;

            case enFileFormat.Xltx:
                df = DocumentFormat.Xltx;
                break;

            case enFileFormat.Undefined:
                df = DocumentFormat.Undefined;
                break;
            }

            btDocument = _pSpreadSheetControl.SaveDocument(df);

            return(btDocument);
        }
コード例 #2
0
        /// <summary>
        /// 스프레드 시트에 파일 로드
        /// </summary>
        /// <param name="byA"></param>
        /// <param name="_enFileFormat"></param>
        public void LoadDocument(Stream _pStream, enFileFormat _enFileFormat)   // 추가
        {
            DocumentFormat df = new DocumentFormat();

            switch (_enFileFormat)
            {
            case enFileFormat.Csv:
                df = DocumentFormat.Csv;
                break;

            case enFileFormat.OpenXml:
                df = DocumentFormat.OpenXml;
                break;

            case enFileFormat.Text:
                df = DocumentFormat.Text;
                break;

            case enFileFormat.Xls:
                df = DocumentFormat.Xls;
                break;

            case enFileFormat.Xlsm:
                df = DocumentFormat.Xlsm;
                break;

            case enFileFormat.Xlsx:
                df = DocumentFormat.Xlsx;
                break;

            case enFileFormat.Xlt:
                df = DocumentFormat.Xlt;
                break;

            case enFileFormat.Xltm:
                df = DocumentFormat.Xltm;
                break;

            case enFileFormat.Xltx:
                df = DocumentFormat.Xltx;
                break;

            case enFileFormat.Undefined:
                df = DocumentFormat.Undefined;
                break;
            }

            _pSpreadSheetControl.LoadDocument(_pStream, df);
        }