Пример #1
0
        /// <summary>
        /// Save the SpreadsheetDocument as OpenDocument spreadsheet document
        /// </summary>
        /// <param name="filename">The filename. With or without full path. Without will save the file to application path!</param>
        public void SaveTo(string filename)
        {
            this.CreateContentBody();

            //Call the ExportHandler for the first matching IExporter
            ExportHandler exportHandler = new ExportHandler();
            IExporter     iExporter     = exportHandler.GetFirstExporter(
                DocumentTypes.SpreadsheetDocument, filename);

            iExporter.Export(this, filename);
        }
Пример #2
0
        /// <summary>
        /// Save the TextDocument as OpenDocument textdocument.
        /// </summary>
        /// <param name="filename">The filename. With or without full path. Without will save the file to application path!</param>
        public void SaveTo(string filename)
        {
            try
            {
                //Build document first
                foreach (string font in this.FontList)
                {
                    this.AddFont(font);
                }
                this.CreateContentBody();

                //Call the ExportHandler for the first matching IExporter
                ExportHandler exportHandler = new ExportHandler();
                IExporter     iExporter     = exportHandler.GetFirstExporter(
                    DocumentTypes.TextDocument, filename);
                iExporter.Export(this, filename);
            }
            catch (Exception)
            {
                throw;
            }
        }