Пример #1
0
        private void ExportReportTo(ExportType format)
        {
            if (format == null)
            {
                throw new ArgumentNullException("format");
            }

            using (var export = new ExportFormatFactory().GetExportFormat(format.Format))
                using (var stream = new MemoryStream())
                {
                    if (export == null)
                    {
                        throw new NullReferenceException("export");
                    }

                    if (export.SupportsEncoding)
                    {
                        export.SetEncoding(format.Encoding);
                    }

                    if (export.SupportsSpacelife)
                    {
                        export.SetSpacelife(format.Spacelife);
                    }

                    export.Export(_report, stream);
                    _exportStreams[format.GetKey()] = new EpsStreamType(format.GetKey(), stream.ToArray());
                }
        }
Пример #2
0
 public static string GetFileExtension(string fileFormat)
 {
     using (var epsFastReportExport = new ExportFormatFactory().GetExportFormat(fileFormat))
     {
         return(epsFastReportExport == null ? null : epsFastReportExport.FileExtension);
     }
 }