当前位置: 首页>>代码示例>>C#>>正文


C# ExportFormat类代码示例

本文整理汇总了C#中ExportFormat的典型用法代码示例。如果您正苦于以下问题:C# ExportFormat类的具体用法?C# ExportFormat怎么用?C# ExportFormat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExportFormat类属于命名空间,在下文中一共展示了ExportFormat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExportDetails

        // Function  : ExportDetails
        // Arguments : DetailsTable, FormatType, FileName
        // Purpose	 : To get all the column headers in the datatable and
        //               exorts in CSV / Excel format with all columns
        public void ExportDetails(DataTable DetailsTable, ExportFormat FormatType, string FileName)
        {
            try
            {
                if (DetailsTable.Rows.Count == 0)
                    throw new Exception("There are no details to export.");

                // Create Dataset
                DataSet dsExport = new DataSet("Export");
                DataTable dtExport = DetailsTable.Copy();
                dtExport.TableName = "Values";
                dsExport.Tables.Add(dtExport);

                // Getting Field Names
                string[] sHeaders = new string[dtExport.Columns.Count];
                string[] sFileds = new string[dtExport.Columns.Count];

                for (int i = 0; i < dtExport.Columns.Count; i++)
                {
                    //sHeaders[i] = ReplaceSpclChars(dtExport.Columns[i].ColumnName);
                    sHeaders[i] = dtExport.Columns[i].ColumnName;
                    sFileds[i] = ReplaceSpclChars(dtExport.Columns[i].ColumnName);
                }

                if (appType == "Web")
                    Export_with_XSLT_Web(dsExport, sHeaders, sFileds, FormatType, FileName);
                else if (appType == "Win")
                    Export_with_XSLT_Windows(dsExport, sHeaders, sFileds, FormatType, FileName);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
开发者ID:shekar348,项目名称:1PointOne,代码行数:38,代码来源:Export.cs

示例2: ExportStylesheet

        private async static Task<string> ExportStylesheet(IEnumerable<SpriteFragment> fragments, SpriteDocument sprite, string imageFile, ExportFormat format)
        {
            string outputFile = GetFileName(imageFile, sprite, format);
            var outputDirectory = Path.GetDirectoryName(outputFile);
            StringBuilder sb = new StringBuilder().AppendLine(GetDescription(format));
            string root = ProjectHelpers.GetRootFolder();

            foreach (SpriteFragment fragment in fragments)
            {
                var rootAbsoluteUrl = FileHelpers.RelativePath(root, fragment.FileName);

                var bgUrl = sprite.UseAbsoluteUrl ? "/" + FileHelpers.RelativePath(root, imageFile) : FileHelpers.RelativePath(outputFile, imageFile);

                sb.AppendLine(GetSelector(rootAbsoluteUrl, sprite, format) + " {");
                sb.AppendLine("/* You may have to set 'display: block' */");
                sb.AppendLine("\twidth: " + fragment.Width + "px;");
                sb.AppendLine("\theight: " + fragment.Height + "px;");
                sb.AppendLine("\tbackground: url('" + bgUrl + "') -" + fragment.X + "px -" + fragment.Y + "px;");
                sb.AppendLine("}");
            }

            bool IsExists = System.IO.Directory.Exists(outputDirectory);
            if (!IsExists)
                System.IO.Directory.CreateDirectory(outputDirectory);

            ProjectHelpers.CheckOutFileFromSourceControl(outputFile);
            await FileHelpers.WriteAllTextRetry(outputFile, sb.ToString().Replace("-0px", "0"));

            return outputFile;
        }
开发者ID:hanskishore,项目名称:WebEssentials2013,代码行数:30,代码来源:SpriteExporter.cs

示例3: GetExportFormatString

        /// <summary>
        /// Gets the string export format of the specified enum.
        /// </summary>
        /// <param name="f">export format enum</param>
        /// <returns>enum equivalent string export format</returns>
        public static string GetExportFormatString(ExportFormat f)
        {
            int V_SQLServer = SetSQLServerVersion();

            switch (f)
            {
                case ExportFormat.XML:
                    return "XML";
                case ExportFormat.CSV:
                    return "CSV";
                case ExportFormat.Image:
                    return "IMAGE";
                case ExportFormat.PDF:
                    return "PDF";
                case ExportFormat.MHTML:
                    return "MHTML";
                case ExportFormat.HTML4:
                    return "HTML4.0";
                case ExportFormat.HTML32:
                    return "HTML3.2";
                case ExportFormat.Excel:
                    return V_SQLServer <= 2008 ? "EXCEL" : "EXCELOPENXML";
                case ExportFormat.Excel_2003:
                    return "EXCEL";
                case ExportFormat.Word:
                    return V_SQLServer <= 2008 ? "WORD" : "WORDOPENXML";
                case ExportFormat.Word_2003:
                    return "WORD";
                default:
                    return "PDF";
            } // End switch (f)
        }
开发者ID:ststeiger,项目名称:TestReportViewer,代码行数:37,代码来源:WebForm1.aspx.cs

示例4: LoadModel

        public static Root LoadModel(string inputPath, ExportFormat format)
        {
            switch (format)
            {
                case ExportFormat.GR2:
                    {
                        using (var fs = new FileStream(inputPath, FileMode.Open, System.IO.FileAccess.Read, FileShare.ReadWrite))
                        {
                            var root = new LSLib.Granny.Model.Root();
                            var gr2 = new LSLib.Granny.GR2.GR2Reader(fs);
                            gr2.Read(root);
                            root.PostLoad();
                            return root;
                        }
                    }

                case ExportFormat.DAE:
                    {
                        var root = new LSLib.Granny.Model.Root();
                        root.ImportFromCollada(inputPath);
                        return root;
                    }

                default:
                    throw new ArgumentException("Invalid model format");
            }
        }
开发者ID:Norbyte,项目名称:lslib,代码行数:27,代码来源:GR2Utils.cs

示例5: ExportDWGData

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="commandData">Revit command data</param>
        /// <param name="exportFormat">Format to export</param>
        public ExportDWGData(ExternalCommandData commandData, ExportFormat exportFormat)
            : base(commandData, exportFormat)
        {
            m_exportOptionsData = new ExportBaseOptionsData();

            Initialize();
        }
开发者ID:AMEE,项目名称:revit,代码行数:12,代码来源:ExportDWGData.cs

示例6: ExportDataWithViews

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="commandData">Revit command data</param>
        /// <param name="exportFormat">Format to export</param>
        public ExportDataWithViews(ExternalCommandData commandData, ExportFormat exportFormat)
            : base(commandData, exportFormat)
        {
            m_selectViewsData = new SelectViewsData(commandData);

            Initialize();
        }
开发者ID:AMEE,项目名称:revit,代码行数:12,代码来源:ExportDataWithViews.cs

示例7: btnCancel_Click

 private void btnCancel_Click(object sender, EventArgs e)
 {
     IsOK = false;
     ExportContent = ExportContent.None;
     ExportFormat = ExportFormat.None;
     ExportPath = "";
     Close();
 }
开发者ID:rollend,项目名称:LevelUp,代码行数:8,代码来源:ExportOption.cs

示例8: Create

 /// <summary>
 /// 创建导出
 /// </summary>
 /// <param name="format">导出格式</param>
 public IExport Create( ExportFormat format ) {
     switch( format ) {
         case ExportFormat.Xlsx:
             return CreateNpoiExcel2007Export();
         case ExportFormat.Xls:
             return CreateNpoiExcel2003Export();
     }
     throw new NotImplementedException();
 }
开发者ID:BeiMeng,项目名称:GitApplication,代码行数:13,代码来源:ExportFactory.cs

示例9: Export

        public static string Export(IEnumerable<SpriteFragment> fragments, string imageFile, ExportFormat format)
        {
            if (format == ExportFormat.Json)
            {
                return ExportJson(fragments, imageFile);
            }

            return ExportStylesheet(fragments, imageFile, format);
        }
开发者ID:Gordon-Beeming,项目名称:WebEssentials2013,代码行数:9,代码来源:SpriteExporter.cs

示例10: GetExporter

 public static IExporter GetExporter(ExportFormat fmt)
 {
     switch (fmt)
     {
     case ExportFormat.Txt: return new ExporterTxt(CreateView());
     case ExportFormat.Radb: return new ExporterRadb(CreateView());
     default: throw new ArgumentException("Specified format is not supported.");
     }
 }
开发者ID:nitrocaster,项目名称:ListPlayers,代码行数:9,代码来源:ExportManager.cs

示例11: GetDescription

        private static string GetDescription(ExportFormat format)
        {
            string text = "This is an example of how to use the image sprite in your own CSS files";

            if (format != ExportFormat.Css)
                text = "@import this file directly into your existing " + format + " files to use these mixins";

            return "/*" + Environment.NewLine + text + Environment.NewLine + "*/";
        }
开发者ID:Gordon-Beeming,项目名称:WebEssentials2013,代码行数:9,代码来源:SpriteExporter.cs

示例12: Export

        public async static Task<string> Export(IEnumerable<SpriteFragment> fragments, SpriteDocument sprite, string imageFile, ExportFormat format)
        {
            if (format == ExportFormat.Json)
            {
                return ExportJson(fragments, sprite, imageFile);
            }

            return await ExportStylesheet(fragments, sprite, imageFile, format);
        }
开发者ID:hanskishore,项目名称:WebEssentials2013,代码行数:9,代码来源:SpriteExporter.cs

示例13: ReportFormatInfo

 public ReportFormatInfo(ExportFormat pFormat)
 {
     switch (pFormat)
     {
         case ExportFormat.Excel:
             this.Extension = ".xls";
             this.FormatName = "EXCEL";
             this.Mime = @"application/vnd.ms-excel";
             this.Format = pFormat;
             break;
         case ExportFormat.PDF:
             this.Extension = ".pdf";
             this.FormatName = "PDF";
             this.Mime = "application/pdf";
             this.Format = pFormat;
             break;
         case ExportFormat.Html:
             this.Extension = ".htm";
             this.FormatName = "HTML4.0";
             this.Mime = "text/html";
             this.Format = pFormat;
             break;
         case ExportFormat.HtmlFragment:
             this.Extension = ".htm";
             this.FormatName = "HTML4.0";
             this.Mime = "text/html";
             this.Format = pFormat;
             // https://msdn.microsoft.com/en-us/library/ms155395.aspx
             // #oReportCell { width: 100%; }
             // JavaScript:   Indicates whether JavaScript is supported in the rendered report.
             //               The default value is true.
             // HTMLFragment: Indicates whether an HTML fragment is created in place of a full HTML document.
             //               An HTML fragment includes the report content in a TABLE element and omits the HTML and BODY elements.
             //               The default value is false.
             // StyleStream:  Indicates whether styles and scripts are created as a separate stream instead of in the document.
             //               The default value is false.
             // StreamRoot:   The path used for prefixing the value of the src attribute of the IMG element in the HTML report returned by the report server.
             //               By default, the report server provides the path.
             //               You can use this setting to specify a root path for the images in a report (for example, http://<servername>/resources/companyimages).
             // <StreamRoot>/ReportServer/Resources</StreamRoot>
             this.DeviceInfo = @"<DeviceInfo><HTMLFragment>True</HTMLFragment><JavaScript>false</JavaScript><StyleStream>true</StyleStream></DeviceInfo>";
             break;
         case ExportFormat.Image:
             this.Extension = ".tif";
             this.FormatName = "IMAGE";
             this.Mime = "image/tiff";
             this.Format = ExportFormat.PDF;
             break;
         default:
             this.Extension = ".pdf";
             this.FormatName = "PDF";
             this.Mime = "application/pdf";
             this.Format = ExportFormat.PDF;
             break;
     } // End Switch
 }
开发者ID:ststeiger,项目名称:ReportViewerWrapper,代码行数:56,代码来源:ReportFormatInfo.cs

示例14: _Export

        public ActionResult _Export(string svg, ExportFormat format)
        {
            var svgText = HttpUtility.UrlDecode(svg);
            var svgFile = TempFileName() + ".svg";
            System.IO.File.WriteAllText(svgFile, svgText);

            var outFile = DoExport(svgFile, format);
            var attachment = "export" + Path.GetExtension(outFile);

            return File(outFile, MimeTypes[format], attachment);
        }
开发者ID:icvanee,项目名称:kendo-examples-asp-net-mvc,代码行数:11,代码来源:HomeController.cs

示例15: Export

        /// <summary>
        /// 导出SmartGridView的数据源的数据
        /// </summary>
        /// <param name="dt">数据源</param>
        /// <param name="columnNameList">导出的列的列名数组</param>
        /// <param name="exportFormat">导出文件的格式</param>
        /// <param name="fileName">输出文件名</param>
        /// <param name="encoding">编码</param>
        public static void Export(DataTable dt, string[] columnNameList, ExportFormat exportFormat, string fileName, Encoding encoding)
        {
            List<int> columnIndexList = new List<int>();
            DataColumnCollection dcc = dt.Columns;

            foreach (string s in columnNameList)
            {
                columnIndexList.Add(GetColumnIndexByColumnName(dcc, s));
            }

            Export(dt, columnIndexList.ToArray(), exportFormat, fileName, encoding);
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:20,代码来源:Export.cs


注:本文中的ExportFormat类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。