• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ExportFormat类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Load

        private Root Load(string inPath, ExportFormat format)
        {
            switch (format)
            {
                case ExportFormat.GR2:
                    return LoadGR2(inPath);

                case ExportFormat.DAE:
                    return LoadDAE(inPath);

                default:
                    throw new NotImplementedException("Unsupported input format");
            }
        }
开发者ID:Norbyte,项目名称:lslib,代码行数:14,代码来源:Exporter.cs


示例17: ExportBookmarksToFiles

        /// <summary>Exports all bookmarks to PDF files.</summary>
        /// <param name="directory">The directory that the exported files will be written to.</param>
        /// <param name="dpi">The resolution of the output files.</param>
        /// <param name="exportFormat">The format of the exported files.</param>
        public void ExportBookmarksToFiles(string directory, long dpi, ExportFormat exportFormat)
        {
            if (!Directory.Exists(directory))
            {
                throw new DirectoryNotFoundException("Directory not found: " + directory);
            }
            IMouseCursor mc = new MouseCursorClass();
            const int hourglass = 2;
            mc.SetCursor(hourglass);

            IMxDocument mxDoc = _app.Document as IMxDocument;
            IMapBookmarks bookmarks = (IMapBookmarks)mxDoc.FocusMap;

            IEnumSpatialBookmark enumBM = bookmarks.Bookmarks;
            enumBM.Reset();
            ISpatialBookmark sbm = enumBM.Next();

            ProgressDialogFactoryClass dialogFactory = new ProgressDialogFactoryClass();
            var cancelTracker = new CancelTrackerClass();
            IStepProgressor stepProgressor = dialogFactory.Create(cancelTracker, _app.hWnd);
            IProgressDialog2 progDialog = stepProgressor as IProgressDialog2;
            progDialog.CancelEnabled = true;

            progDialog.ShowDialog();
            stepProgressor.Hide();
            stepProgressor.Message = "Exporting...";

            // Create a formatting string with the proper extension.  (E.g., "{0}.pdf" for PDF files".)
            string fnFmt = string.Format("{{0}}.{0}", Enum.GetName(typeof(ExportFormat), exportFormat));
            try
            {
                while (sbm != null)
                {
                    sbm.ZoomTo(mxDoc.FocusMap);
                    string filename = System.IO.Path.Combine(directory, string.Format(fnFmt, sbm.Name));
                    ExportPageLayoutToFile(mxDoc.PageLayout, filename, dpi, exportFormat);
                    sbm = enumBM.Next();
                }
            }
            finally
            {
                if (progDialog != null)
                {
                    progDialog.HideDialog();
                    ComReleaser.ReleaseCOMObject(progDialog);
                }
            }
        }
开发者ID:WSDOT-GIS,项目名称:ArcMapBookmarkExporter,代码行数:52,代码来源:Exporter.cs


示例18: btnOK_Click

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (rbExportNew.Checked)
            {
                ExportContent = ExportContent.New;
            }
            if (rbExportCommon.Checked)
            {
                ExportContent = ExportContent.Common;
            }

            if (rbXML.Checked)
            {
                ExportFormat = ExportFormat.XML;
                ExportPath = tbXMLPath.Text;
            }
            if (rbText.Checked)
            {
                ExportFormat = ExportFormat.Text;
                ExportPath = tbTextPath.Text;
            }
            if (rbCopyFiles.Checked)
            {
                ExportFormat = ExportFormat.CopyFile;
                ExportPath = tbCopyFilePath.Text;
            }
            if (rbMoveFiles.Checked)
            {
                ExportFormat = ExportFormat.MoveFile;
                ExportPath = tbMoveFilePath.Text;
            }

            if (
                ExportContent != ExportContent.None
                && ExportFormat != ExportFormat.None
                && !string.IsNullOrEmpty(ExportPath)
                )
            {
                IsOK = true;
                Close();
            }
            else
            {
                MessageBox.Show("Export options has some matters. Please check and repair options.");
            }
        }
开发者ID:rollend,项目名称:LevelUp,代码行数:46,代码来源:ExportOption.cs


示例19: ExportConversations

        public void ExportConversations(ExportFormat exportFormat, string exportPath, IProgressCallback progressCallback)
        {
            IConversationExporter conversationExporter;
            switch (exportFormat)
            {
                case ExportFormat.Html:
                    conversationExporter = new ConversationExporterHtml(_exportFileSystem);
                    break;
                case ExportFormat.Plaintext:
                    conversationExporter = new ConversationExporterPlaintext(_exportFileSystem);
                    break;
                default:
                    throw new ArgumentException("Unrecognized export format.");
            }

            _exportErrors = conversationExporter.ExportMultipleConversations(_conversationManager, _displayOptions, exportPath, progressCallback);
        }
开发者ID:jzajac2,项目名称:AllYourTexts,代码行数:17,代码来源:ExportMultipleDialogModel.cs


示例20: ExportDetails

 public void ExportDetails(Janus.Windows.GridEX.GridEX Grilla, ExportFormat FormatType, string FileName)
 {
     System.Diagnostics.Process loProcess = System.Diagnostics.Process.GetCurrentProcess();
     loProcess.MaxWorkingSet = (IntPtr)10000000;
     loProcess.MinWorkingSet = (IntPtr)5000000;
     try
     {
         DataSet dsExport = Cedeira.SV.Fun.GetDataSetFromJanusGridEx(Grilla, FileName);
         dsExport.DataSetName = "Export";
         dsExport.Tables[0].TableName = "Values";
         string[] sHeaders = new string[dsExport.Tables[0].Columns.Count];
         string[] sFileds = new string[dsExport.Tables[0].Columns.Count];
         for (int i = 0; i < dsExport.Tables[0].Columns.Count; i++)
         {
             dsExport.Tables[0].Columns[i].ColumnName = Convert.ToString(i);
         }
         for (int i = 0; i < dsExport.Tables[0].Columns.Count; i++)
         {
             sHeaders[i] = ReemplazarEspaciosyAcentos(dsExport.Tables[0].Columns[i].Caption);
             dsExport.Tables[0].Columns[i].ColumnName = sHeaders[i];
             sFileds[i] = sHeaders[i];
         }
         for (int l = 0; l < dsExport.Tables[0].Rows.Count; l++)
         {
             for (int i = 0; i < dsExport.Tables[0].Columns.Count; i++)
             {
                 string aux = ReemplazarXPath(Convert.ToString(dsExport.Tables[0].Rows[l].ItemArray[i]));
                 dsExport.Tables[0].Rows[l][i] = aux;
                 dsExport.Tables[0].Rows[l].AcceptChanges();
             }
         }
         string dir = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) + "\\CedForecast\\";
         if (!System.IO.Directory.Exists(dir))
         {
             System.IO.Directory.CreateDirectory(dir);
         }
         FileName = dir + ReemplazarCaracteresMalos(FileName);
         Export_with_XSLT_Windows(dsExport, sHeaders, sFileds, FormatType, FileName);
         System.Diagnostics.Process.Start(FileName);
     }
     catch (Exception Ex)
     {
         throw Ex;
     }
 }
开发者ID:pjeconde,项目名称:CedForecast,代码行数:45,代码来源:Export.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ExportHandle类代码示例发布时间:2022-05-24
下一篇:
C# ExportContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap