Exemplo n.º 1
0
        /// <summary>
        /// Contains data relating to the file-transfer aspects of the report.
        /// </summary>
        /// <param name="source">The template filename. This may be an AppSettings key, a virtual path, or just the filename if it exists.</param>
        /// <param name="name">The filename to use when saving/downloading the report.</param>
        /// <param name="method">The optional save method to use: Local or Download.</param>
        public XlFileInfo(string source, string name, XlSaveMethod method = XlSaveMethod.Local)
        {
            FileName = name;

            if (method == XlSaveMethod.Download)
            {
                Output = new XlDownload();
            }
            else
            {
                Output = new XlDownload/*AndBackup*/ ();
            }

            FileSource = new XlFileSource(source);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Contains data relating to the file-transfer aspects of the report. This overload is used when there is no template file being used, and no backup directory is provided.
        /// </summary>
        /// <param name="name">The FileName to use when saving the report.</param>
        /// <param name="data">List of sheets to create the report.</param>
        /// <param name="method">The optional save method: Local or Download.</param>
        public XlFileInfo(string name, IEnumerable <XlSheet> data, XlSaveMethod method = XlSaveMethod.Local)
        {
            FileName = name;

            if (method == XlSaveMethod.Download)
            {
                Output = new XlDownload();
            }
            else
            {
                Output = new XlDownloadAndBackup();
            }

            FileSource = new XlBlankSource(data);
        }